set directory of file dialog when opening file by double-click, recent files list or drag and drop

This commit is contained in:
wmayer
2016-10-16 14:47:13 +02:00
parent 3638588c8e
commit 7fdf39244d
5 changed files with 42 additions and 10 deletions

View File

@@ -1026,7 +1026,11 @@ void MainWindow::processMessages(const QList<QByteArray> & msg)
if (it->startsWith(action))
files.push_back(std::string(it->mid(action.size()).constData()));
}
App::Application::processFiles(files);
files = App::Application::processFiles(files);
for (std::list<std::string>::iterator it = files.begin(); it != files.end(); ++it) {
QString filename = QString::fromUtf8(it->c_str(), it->size());
FileDialog::setWorkingDirectory(filename);
}
}
catch (const Base::SystemExitException&) {
}
@@ -1036,7 +1040,12 @@ void MainWindow::delayedStartup()
{
// processing all command line files
try {
App::Application::processCmdLineFiles();
std::list<std::string> files = App::Application::getCmdLineFiles();
files = App::Application::processFiles(files);
for (std::list<std::string>::iterator it = files.begin(); it != files.end(); ++it) {
QString filename = QString::fromUtf8(it->c_str(), it->size());
FileDialog::setWorkingDirectory(filename);
}
}
catch (const Base::SystemExitException&) {
throw;