mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Fix the first load of Subsurface - "File not found" error.
The first time the user loads subsurface, the default_filename is not configured yet, but yet the software tries to load "", sending an error message that this file doesn't exists. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Taiane Ramos <exhora.tat@gmail.com>
This commit is contained in:
parent
6ae6c768f3
commit
7bd43bfaaf
2 changed files with 9 additions and 2 deletions
5
main.cpp
5
main.cpp
|
@ -52,9 +52,10 @@ int main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
if (no_filenames) {
|
||||
files.push_back( QString(prefs.default_filename) );
|
||||
QString defaultFile(prefs.default_filename);
|
||||
if (!defaultFile.isEmpty())
|
||||
files.push_back( QString(prefs.default_filename) );
|
||||
}
|
||||
|
||||
parse_xml_exit();
|
||||
subsurface_command_line_exit(&argc, &argv);
|
||||
mainWindow()->loadFiles(files);
|
||||
|
|
|
@ -748,6 +748,9 @@ void MainWindow::setTitle(enum MainWindowTitleFormat format)
|
|||
|
||||
void MainWindow::importFiles(const QStringList fileNames)
|
||||
{
|
||||
if (fileNames.isEmpty())
|
||||
return;
|
||||
|
||||
QByteArray fileNamePtr;
|
||||
char *error = NULL;
|
||||
for (int i = 0; i < fileNames.size(); ++i) {
|
||||
|
@ -771,6 +774,9 @@ void MainWindow::importFiles(const QStringList fileNames)
|
|||
|
||||
void MainWindow::loadFiles(const QStringList fileNames)
|
||||
{
|
||||
if (fileNames.isEmpty())
|
||||
return;
|
||||
|
||||
char *error = NULL;
|
||||
QByteArray fileNamePtr;
|
||||
|
||||
|
|
Loading…
Reference in a new issue