Changeset bbac1ebb13 in tspsg for src/mainwindow.cpp


Ignore:
Timestamp:
Sep 5, 2010, 11:03:48 PM (14 years ago)
Author:
Oleksii Serdiuk
Branches:
0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
Children:
2a436ea693
Parents:
b2e8e7ec71
git-author:
Oleksii Serdiuk <contacts@…> (09/05/10 23:03:48)
git-committer:
Oleksii Serdiuk <contacts@…> (06/29/12 19:45:57)
Message:

Save platform dependent settings (e.g., paths) per platform. This enables sharing of the settings file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mainwindow.cpp

    rb2e8e7ec71 rbbac1ebb13  
    160160QString file;
    161161        if ((fileName == tr("Untitled") + ".tspt") && settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool())
    162                 file = settings->value("LastUsed/TaskLoadPath").toString();
     162                file = settings->value(OS"/LastUsed/TaskLoadPath").toString();
    163163        else
    164164                file = QFileInfo(fileName).path();
     
    168168                return;
    169169        if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool())
    170                 settings->setValue("LastUsed/TaskLoadPath", QFileInfo(file).path());
     170                settings->setValue(OS"/LastUsed/TaskLoadPath", QFileInfo(file).path());
    171171
    172172        if (!tspmodel->loadTask(file))
     
    201201        if (selectedFile.isEmpty()) {
    202202                if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool()) {
    203                         selectedFile = settings->value("LastUsed/SolutionSavePath").toString();
     203                        selectedFile = settings->value(OS"/LastUsed/SolutionSavePath").toString();
    204204                }
    205205        } else
     
    237237        selectedFile = file;
    238238        if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool())
    239                 settings->setValue("LastUsed/SolutionSavePath", QFileInfo(selectedFile).path());
     239                settings->setValue(OS"/LastUsed/SolutionSavePath", QFileInfo(selectedFile).path());
    240240        QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
    241241#ifndef QT_NO_PRINTER
     
    454454
    455455QString title;
    456 #ifdef HANDHELD
    457         title += QString("<b>TSPSG<br>TSP Solver and Generator</b><br>");
    458 #else
    459456        title += QString("<b>%1</b><br>").arg(QApplication::applicationName());
    460 #endif // HANDHELD
    461457        title += QString("%1: <b>%2</b><br>").arg(tr("Version"), QApplication::applicationVersion());
    462458#ifndef HANDHELD
     
    466462
    467463QString about;
    468         about += QString("%1: <b>%2</b><br>").arg(tr("Target OS (ARCH)"), OS);
     464        about += QString("%1: <b>%2</b><br>").arg(tr("Target OS (ARCH)"), PLATFROM);
    469465#ifndef STATIC_BUILD
    470466        about += QString("%1 (%2):<br>").arg(tr("Qt library"), tr("shared"));
     
    474470        about += QString("%1: <b>%2</b> (%3)<br>").arg(tr("Qt library"), QT_VERSION_STR, tr("static"));
    475471#endif // STATIC_BUILD
    476         about += tr("Buid <b>%1</b>, built on <b>%2</b> at <b>%3</b>").arg(BUILD_NUMBER).arg(__DATE__).arg(__TIME__) + "<br>";
     472        about += tr("Buid <b>%1</b>, built on <b>%2</b> at <b>%3</b> with <b>%4</b> compiler.").arg(BUILD_NUMBER).arg(__DATE__).arg(__TIME__).arg(COMPILER) + "<br>";
    477473        about += QString("%1: <b>%2</b><br>").arg(tr("Algorithm"), CTSPSolver::getVersionId());
    478474        about += "<br>";
     
    14481444QString file;
    14491445        if ((fileName == tr("Untitled") + ".tspt") && settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool()) {
    1450                 file = settings->value("LastUsed/TaskSavePath").toString();
     1446                file = settings->value(OS"/LastUsed/TaskSavePath").toString();
    14511447                if (!file.isEmpty())
    14521448                        file.append("/");
     
    14621458                return false;
    14631459        else if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool())
    1464                 settings->setValue("LastUsed/TaskSavePath", QFileInfo(file).path());
     1460                settings->setValue(OS"/LastUsed/TaskSavePath", QFileInfo(file).path());
    14651461
    14661462        if (tspmodel->saveTask(file)) {
Note: See TracChangeset for help on using the changeset viewer.