Added support for portable mode [Thanks Chris]
Portable mode is enabled by passing the "--portable" command line option More i8n cleanups FossilOrigin-Name: 9cb380713c661f2ac8250800ef8e8b01fa9dafdc
This commit is contained in:
39
main.cpp
39
main.cpp
@ -3,24 +3,39 @@
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
a.setApplicationName("Fuel");
|
||||
a.setApplicationVersion("0.9.6");
|
||||
a.setOrganizationDomain("fuel-scm.org");
|
||||
a.setOrganizationName("Fuel-SCM");
|
||||
QApplication app(argc, argv);
|
||||
app.setApplicationName("Fuel");
|
||||
app.setApplicationVersion("0.9.6");
|
||||
app.setOrganizationDomain("fuel-scm.org");
|
||||
app.setOrganizationName("Fuel-SCM");
|
||||
|
||||
// Native OSX applications don't use menu icons
|
||||
#ifdef Q_WS_MACX
|
||||
// Native OSX applications don't use menu icons
|
||||
a.setAttribute(Qt::AA_DontShowIconsInMenus);
|
||||
#endif
|
||||
|
||||
{
|
||||
bool portable = false;
|
||||
QString workspace;
|
||||
if(a.arguments().length()>1)
|
||||
workspace = a.arguments()[1];
|
||||
|
||||
Q_ASSERT(app.arguments().size()>0);
|
||||
for(int i=1; i<app.arguments().size(); ++i)
|
||||
{
|
||||
QString arg = app.arguments()[i];
|
||||
// Parse options
|
||||
if(arg.indexOf("--")!=-1)
|
||||
{
|
||||
if(arg.indexOf("portable")!=-1)
|
||||
portable = true;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
workspace = arg;
|
||||
}
|
||||
|
||||
MainWindow w(0, &workspace);
|
||||
w.show();
|
||||
return a.exec();
|
||||
MainWindow mainwin(0,
|
||||
workspace.isEmpty() ? 0 : &workspace,
|
||||
portable);
|
||||
mainwin.show();
|
||||
return app.exec();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user