|
|
|
@ -20,6 +20,7 @@
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QCommandLineParser>
|
|
|
|
#include <QCommandLineParser>
|
|
|
|
#include <QQmlApplicationEngine>
|
|
|
|
#include <QQmlApplicationEngine>
|
|
|
|
|
|
|
|
#include <QQmlContext>
|
|
|
|
|
|
|
|
|
|
|
|
#include <QTranslator>
|
|
|
|
#include <QTranslator>
|
|
|
|
#include <QLocale>
|
|
|
|
#include <QLocale>
|
|
|
|
@ -66,9 +67,12 @@ int main(int argc, char *argv[])
|
|
|
|
parser.setApplicationDescription(QStringLiteral("File Manager"));
|
|
|
|
parser.setApplicationDescription(QStringLiteral("File Manager"));
|
|
|
|
parser.addHelpOption();
|
|
|
|
parser.addHelpOption();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parser.addPositionalArgument("files", "Files", "[FILE1, FILE2,...]");
|
|
|
|
|
|
|
|
|
|
|
|
QCommandLineOption desktopOption(QStringList() << "d" << "desktop" << "Desktop Mode");
|
|
|
|
QCommandLineOption desktopOption(QStringList() << "d" << "desktop" << "Desktop Mode");
|
|
|
|
parser.addOption(desktopOption);
|
|
|
|
parser.addOption(desktopOption);
|
|
|
|
parser.process(app);
|
|
|
|
parser.process(app);
|
|
|
|
|
|
|
|
parser.addHelpOption();
|
|
|
|
|
|
|
|
|
|
|
|
if (parser.isSet(desktopOption)) {
|
|
|
|
if (parser.isSet(desktopOption)) {
|
|
|
|
DesktopView view;
|
|
|
|
DesktopView view;
|
|
|
|
@ -84,6 +88,13 @@ int main(int argc, char *argv[])
|
|
|
|
if (!obj && url == objUrl)
|
|
|
|
if (!obj && url == objUrl)
|
|
|
|
QCoreApplication::exit(-1);
|
|
|
|
QCoreApplication::exit(-1);
|
|
|
|
}, Qt::QueuedConnection);
|
|
|
|
}, Qt::QueuedConnection);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Handle urls
|
|
|
|
|
|
|
|
if (!parser.positionalArguments().isEmpty()) {
|
|
|
|
|
|
|
|
QStringList arguments = parser.positionalArguments();
|
|
|
|
|
|
|
|
engine.rootContext()->setContextProperty("arg", arguments.first());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
engine.load(url);
|
|
|
|
engine.load(url);
|
|
|
|
engine.addImageProvider("thumbnailer", new Thumbnailer());
|
|
|
|
engine.addImageProvider("thumbnailer", new Thumbnailer());
|
|
|
|
|
|
|
|
|
|
|
|
|