Changeset 133 in tspsg-svn for trunk/src


Ignore:
Timestamp:
Sep 5, 2010, 11:03:48 PM (14 years ago)
Author:
laleppa
Message:

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

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mainwindow.cpp

    r131 r133  
    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)) {
  • trunk/src/os.h

    r132 r133  
    6666 */
    6767#ifdef Q_OS_AIX
    68         #define OS "AIX"ARCH
     68        #define OS "AIX"
    6969        #define OSID quint8(1)
    7070#elif defined Q_OS_BSD4
    71         #define OS "BSD 4.4"ARCH
     71        #define OS "BSD 4.4"
    7272        #define OSID quint8(2)
    7373#elif defined Q_OS_BSDI
    74         #define OS "BSD/OS"ARCH
     74        #define OS "BSD/OS"
    7575        #define OSID quint8(3)
    7676#elif defined Q_OS_CYGWIN
    77         #define OS "Cygwin"ARCH
     77        #define OS "Cygwin"
    7878        #define OSID quint8(4)
    7979#elif defined Q_OS_DGUX
    80         #define OS "DG/UX"ARCH
     80        #define OS "DG/UX"
    8181        #define OSID quint8(5)
    8282#elif defined Q_OS_DYNIX
    83         #define OS "DYNIX/ptx"ARCH
     83        #define OS "DYNIX/ptx"
    8484        #define OSID quint8(6)
    8585#elif defined Q_OS_FREEBSD
    86         #define OS "FreeBSD"ARCH
     86        #define OS "FreeBSD"
    8787        #define OSID quint8(7)
    8888#elif defined Q_OS_HPUX
    89         #define OS "HP-UX"ARCH
     89        #define OS "HP-UX"
    9090        #define OSID quint8(8)
    9191#elif defined Q_OS_HURD
    92         #define OS "GNU Hurd"ARCH
     92        #define OS "GNU Hurd"
    9393        #define OSID quint8(9)
    9494#elif defined Q_OS_IRIX
    95         #define OS "SGI Irix"ARCH
     95        #define OS "SGI Irix"
    9696        #define OSID quint8(10)
    9797#elif defined Q_OS_LINUX
    98         #define OS "Linux"ARCH
     98        #define OS "Linux"
    9999        #define OSID quint8(11)
    100100#elif defined Q_OS_LYNX
    101         #define OS "LynxOS"ARCH
     101        #define OS "LynxOS"
    102102        #define OSID quint8(12)
    103103#elif defined Q_OS_MAC
    104         #define OS "Mac OS (Darwin)"ARCH
     104        #define OS "Mac OS (Darwin)"
    105105        #define OSID quint8(13)
    106106#elif defined Q_OS_MSDOS
    107         #define OS "MS-DOS"ARCH
     107        #define OS "MS-DOS"
    108108        #define OSID quint8(14)
    109109#elif defined Q_OS_NETBSD
    110         #define OS "NetBSD"ARCH
     110        #define OS "NetBSD"
    111111        #define OSID quint8(15)
    112112#elif defined Q_OS_OS2
    113         #define OS "OS/2"ARCH
     113        #define OS "OS/2"
    114114        #define OSID quint8(16)
    115115#elif defined Q_OS_OPENBSD
    116         #define OS "OpenBSD"ARCH
     116        #define OS "OpenBSD"
    117117        #define OSID quint8(17)
    118118#elif defined Q_OS_OS2EMX
    119         #define OS "OS/2"ARCH
     119        #define OS "OS/2"
    120120        #define OSID quint8(18)
    121121#elif defined Q_OS_OSF
    122         #define OS "HP Tru64 UNIX"ARCH
     122        #define OS "HP Tru64 UNIX"
    123123        #define OSID quint8(19)
    124124#elif defined Q_OS_QNX
    125         #define OS "QNX Neutrino"ARCH
     125        #define OS "QNX Neutrino"
    126126        #define OSID quint8(20)
    127127#elif defined Q_OS_RELIANT
    128         #define OS "Reliant UNIX"ARCH
     128        #define OS "Reliant UNIX"
    129129        #define OSID quint8(21)
    130130#elif defined Q_OS_SCO
    131         #define OS "SCO OpenServer 5"ARCH
     131        #define OS "SCO OpenServer 5"
    132132        #define OSID quint8(22)
    133133#elif defined Q_OS_SOLARIS
    134         #define OS "Sun Solaris"ARCH
     134        #define OS "Sun Solaris"
    135135        #define OSID quint8(23)
    136136#elif defined Q_OS_SYMBIAN
    137         #define OS "Symbian"ARCH
     137        #define OS "Symbian"
    138138        #define OSID quint8(24)
    139139#elif defined Q_OS_ULTRIX
    140         #define OS "DEC Ultrix"ARCH
     140        #define OS "DEC Ultrix"
    141141        #define OSID quint8(25)
    142142#elif defined Q_OS_UNIX
    143         #define OS "UNIX BSD/SYSV"ARCH
     143        #define OS "UNIX BSD/SYSV"
    144144        #define OSID quint8(26)
    145145#elif defined Q_OS_UNIXWARE
    146         #define OS "UnixWare 7/Open UNIX 8"ARCH
     146        #define OS "UnixWare 7/Open UNIX 8"
    147147        #define OSID quint8(27)
    148148#elif defined Q_OS_WIN32
    149         #define OS "Windows"ARCH
     149        #define OS "Windows"
    150150        #define OSID quint8(28)
    151151#elif defined Q_OS_WINCE_WM
    152         #define OS "Windows Mobile"ARCH
     152        #define OS "Windows Mobile"
    153153        #define OSID quint8(29)
    154154#elif defined Q_OS_WINCE
    155         #define OS "Windows CE"ARCH
     155        #define OS "Windows CE"
    156156        #define OSID quint8(30)
    157157#else
    158         #define OS "Unknown"ARCH
     158        #define OS "Unknown"
    159159        #define OSID quint8(255)
    160160#endif // OS
    161161
     162//! The target platform in the form OS ARCH
     163#define PLATFROM OS ARCH
     164
     165/*!
     166 * \def COMPILER
     167 * \brief The compiler TSPSG was built with.
     168 */
     169#ifdef Q_CC_MSVC
     170        #define COMPILER "Microsoft Visual C/C++ or Intel C++ for Windows"
     171#elif defined(Q_CC_GNU)
     172        #define COMPILER "GNU C++"
     173#elif defined(Q_CC_INTEL)
     174        #define COMPILER "Intel C++ for Linux or Intel C++ for Windows"
     175#elif defined(Q_CC_GCCE)
     176        #define COMPILER "GCCE (Symbian GCCE builds)"
     177#elif defined(Q_CC_RVCT)
     178        #define COMPILER "ARM Realview Compiler Suite"
     179#elif defined(Q_CC_NOKIAX86)
     180        #define COMPILER "Nokia x86 (Symbian WINSCW builds)"
     181#else
     182        #define COMPILER "Unknown"
     183#endif
     184
    162185#endif // OS_H
Note: See TracChangeset for help on using the changeset viewer.