Changeset View
Changeset View
Standalone View
Standalone View
kioclient/kioclient.cpp
Show All 33 Lines | |||||
34 | 34 | | |||
35 | #include <QDBusConnection> | 35 | #include <QDBusConnection> | ||
36 | #include <QCommandLineParser> | 36 | #include <QCommandLineParser> | ||
37 | #include <QFileDialog> | 37 | #include <QFileDialog> | ||
38 | #include <QDebug> | 38 | #include <QDebug> | ||
39 | #include <iostream> | 39 | #include <iostream> | ||
40 | 40 | | |||
41 | bool ClientApp::m_ok = true; | 41 | bool ClientApp::m_ok = true; | ||
42 | static bool s_interactive = true; | 42 | static bool s_interactive = false; | ||
43 | static KIO::JobFlags s_jobFlags = KIO::DefaultFlags; | 43 | static KIO::JobFlags s_jobFlags = KIO::DefaultFlags; | ||
44 | 44 | | |||
45 | static QUrl makeURL(const QString &urlArg) | 45 | static QUrl makeURL(const QString &urlArg) | ||
46 | { | 46 | { | ||
47 | return QUrl::fromUserInput(urlArg, QDir::currentPath()); | 47 | return QUrl::fromUserInput(urlArg, QDir::currentPath()); | ||
48 | } | 48 | } | ||
49 | 49 | | |||
50 | static QList<QUrl> makeUrls(const QStringList& urlArgs) | 50 | static QList<QUrl> makeUrls(const QStringList& urlArgs) | ||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 116 | #endif | |||
121 | QString programName = i18n("KIO Client"); | 121 | QString programName = i18n("KIO Client"); | ||
122 | QString description = i18n("Command-line tool for network-transparent operations"); | 122 | QString description = i18n("Command-line tool for network-transparent operations"); | ||
123 | QString version = QLatin1String(PROJECT_VERSION); | 123 | QString version = QLatin1String(PROJECT_VERSION); | ||
124 | KAboutData data(appName, programName, version, description, KAboutLicense::LGPL_V2); | 124 | KAboutData data(appName, programName, version, description, KAboutLicense::LGPL_V2); | ||
125 | KAboutData::setApplicationData(data); | 125 | KAboutData::setApplicationData(data); | ||
126 | 126 | | |||
127 | QCommandLineParser parser; | 127 | QCommandLineParser parser; | ||
128 | data.setupCommandLine(&parser); | 128 | data.setupCommandLine(&parser); | ||
129 | parser.addOption(QCommandLineOption(QStringLiteral("interactive"), i18n("Use message boxes and other native notifications"))); | ||||
130 | | ||||
129 | parser.addOption(QCommandLineOption(QStringLiteral("noninteractive"), i18n("Non-interactive use: no message boxes. If you don't want a " | 131 | parser.addOption(QCommandLineOption(QStringLiteral("noninteractive"), i18n("Non-interactive use: no message boxes. If you don't want a " | ||
130 | "graphical connection, use --platform offscreen"))); | 132 | "graphical connection, use --platform offscreen"))); | ||
131 | 133 | | |||
132 | #if !defined(KIOCLIENT_AS_KDEOPEN) | 134 | #if !defined(KIOCLIENT_AS_KDEOPEN) | ||
133 | parser.addOption(QCommandLineOption(QStringLiteral("overwrite"), i18n("Overwrite destination if it exists (for copy and move)"))); | 135 | parser.addOption(QCommandLineOption(QStringLiteral("overwrite"), i18n("Overwrite destination if it exists (for copy and move)"))); | ||
134 | #endif | 136 | #endif | ||
135 | 137 | | |||
136 | #if defined(KIOCLIENT_AS_KDEOPEN) | 138 | #if defined(KIOCLIENT_AS_KDEOPEN) | ||
▲ Show 20 Lines • Show All 127 Lines • ▼ Show 20 Line(s) | 260 | { | |||
264 | return m_ok; | 266 | return m_ok; | ||
265 | } | 267 | } | ||
266 | 268 | | |||
267 | bool ClientApp::doIt(const QCommandLineParser& parser) | 269 | bool ClientApp::doIt(const QCommandLineParser& parser) | ||
268 | { | 270 | { | ||
269 | const int argc = parser.positionalArguments().count(); | 271 | const int argc = parser.positionalArguments().count(); | ||
270 | checkArgumentCount(argc, 1, 0); | 272 | checkArgumentCount(argc, 1, 0); | ||
271 | 273 | | |||
272 | if ( !parser.isSet( QStringLiteral("noninteractive") ) ) { | 274 | if (parser.isSet(QStringLiteral("interactive"))) { | ||
275 | s_interactive = true; | ||||
276 | } else { | ||||
277 | // interactive used to be the default, but due to a porting error it broke | ||||
278 | // for compatibility noninteractive is now the default (TODO change for Plasma 6?) | ||||
dfaure: Why would we want to break compatibility yet again? ;-) | |||||
273 | s_interactive = false; | 279 | s_interactive = false; | ||
274 | s_jobFlags = KIO::HideProgressInfo; | 280 | s_jobFlags = KIO::HideProgressInfo; | ||
275 | } | 281 | } | ||
276 | #if !defined(KIOCLIENT_AS_KDEOPEN) | 282 | #if !defined(KIOCLIENT_AS_KDEOPEN) | ||
277 | if (parser.isSet(QStringLiteral("overwrite"))) { | 283 | if (parser.isSet(QStringLiteral("overwrite"))) { | ||
278 | s_jobFlags |= KIO::Overwrite; | 284 | s_jobFlags |= KIO::Overwrite; | ||
279 | } | 285 | } | ||
280 | #endif | 286 | #endif | ||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |
Why would we want to break compatibility yet again? ;-)