mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-17 19:36:15 +00:00
Make default file behavior work as expected
Subsurface will now start with the no default file, the local default file or cloud storage as chosen in the preferences. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
10b9202757
commit
782d5b3689
1 changed files with 10 additions and 3 deletions
13
main.cpp
13
main.cpp
|
@ -11,6 +11,7 @@
|
||||||
#include "qt-ui/mainwindow.h"
|
#include "qt-ui/mainwindow.h"
|
||||||
#include "qt-ui/diveplanner.h"
|
#include "qt-ui/diveplanner.h"
|
||||||
#include "qt-ui/graphicsview-common.h"
|
#include "qt-ui/graphicsview-common.h"
|
||||||
|
#include "qthelper.h"
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <git2.h>
|
#include <git2.h>
|
||||||
|
@ -56,9 +57,15 @@ int main(int argc, char **argv)
|
||||||
taglist_init_global();
|
taglist_init_global();
|
||||||
init_ui();
|
init_ui();
|
||||||
if (no_filenames) {
|
if (no_filenames) {
|
||||||
QString defaultFile(prefs.default_filename);
|
if (prefs.default_file_behavior == LOCAL_DEFAULT_FILE) {
|
||||||
if (!defaultFile.isEmpty())
|
QString defaultFile(prefs.default_filename);
|
||||||
files.push_back(QString(prefs.default_filename));
|
if (!defaultFile.isEmpty())
|
||||||
|
files.push_back(QString(prefs.default_filename));
|
||||||
|
} else if (prefs.default_file_behavior == CLOUD_DEFAULT_FILE) {
|
||||||
|
QString cloudURL;
|
||||||
|
if (getCloudURL(cloudURL) == 0)
|
||||||
|
files.push_back(cloudURL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow *m = MainWindow::instance();
|
MainWindow *m = MainWindow::instance();
|
||||||
|
|
Loading…
Add table
Reference in a new issue