mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-20 06:45:27 +00:00
More code cleanup.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b28237309a
commit
a6615f67cd
1 changed files with 4 additions and 12 deletions
|
@ -99,11 +99,10 @@ void MainWindow::on_actionNew_triggered()
|
|||
|
||||
void MainWindow::on_actionOpen_triggered()
|
||||
{
|
||||
QString lastDir = lastUsedDir();
|
||||
QString filename = QFileDialog::getOpenFileName(this, tr("Open File"), lastDir, filter());
|
||||
QString filename = QFileDialog::getOpenFileName(this, tr("Open File"), lastUsedDir(), filter());
|
||||
if (filename.isEmpty())
|
||||
return;
|
||||
updateLastUsedDir(filename);
|
||||
updateLastUsedDir(QFileInfo(filename).dir().path());
|
||||
on_actionClose_triggered();
|
||||
loadFiles( QStringList() << filename );
|
||||
}
|
||||
|
@ -150,12 +149,9 @@ void MainWindow::on_actionClose_triggered()
|
|||
|
||||
void MainWindow::on_actionImport_triggered()
|
||||
{
|
||||
QString lastDir = lastUsedDir();
|
||||
|
||||
QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Import Files"), lastDir, filter());
|
||||
QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Import Files"), lastUsedDir(), filter());
|
||||
if (!fileNames.size())
|
||||
return; // no selection
|
||||
|
||||
updateLastUsedDir(QFileInfo(fileNames.at(0)).dir().path());
|
||||
importFiles(fileNames);
|
||||
}
|
||||
|
@ -181,10 +177,8 @@ void MainWindow::updateLastUsedDir(const QString& dir)
|
|||
|
||||
void MainWindow::on_actionExportUDDF_triggered()
|
||||
{
|
||||
QString filename;
|
||||
QFileInfo fi(system_default_filename());
|
||||
|
||||
filename = QFileDialog::getSaveFileName(this, tr("Save File as"), fi.absolutePath(),
|
||||
QString filename = QFileDialog::getSaveFileName(this, tr("Save File as"), fi.absolutePath(),
|
||||
tr("UDDF files (*.uddf *.UDDF)"));
|
||||
if (!filename.isNull() && !filename.isEmpty())
|
||||
export_dives_uddf((const char *)filename.toStdString().c_str(), false);
|
||||
|
@ -228,7 +222,6 @@ void MainWindow::showProfile()
|
|||
ui.infoPane->setCurrentIndex(MAINTAB);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionPreferences_triggered()
|
||||
{
|
||||
PreferencesDialog::instance()->show();
|
||||
|
@ -820,7 +813,6 @@ void MainWindow::on_actionImportCSV_triggered()
|
|||
refreshDisplay();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::editCurrentDive()
|
||||
{
|
||||
if(DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING){
|
||||
|
|
Loading…
Add table
Reference in a new issue