Changeset 31694c8b58 in tspsg for src
- Timestamp:
- Sep 16, 2012, 10:40:01 PM (12 years ago)
- Branches:
- appveyor, imgbot, master, readme
- Children:
- 1b0d08aa2e
- Parents:
- 0784c85e46
- git-author:
- Oleksii Serdiuk <contacts@…> (09/16/12 22:40:01)
- git-committer:
- Oleksii Serdiuk <contacts@…> (09/16/12 22:41:39)
- Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/globals.cpp
r0784c85e46 r31694c8b58 24 24 #include "globals.h" 25 25 26 #ifdef Q_OS_WINCE_WM 27 # include <shellapi.h> 28 #endif 29 30 QSettings *initSettings(QObject *parent) 31 { 32 #ifdef Q_OS_WINCE_WM 33 /*! 34 * \hack HACK: On Windows Mobile the way Qt tries to get path for saving 35 * settings doesn't always work. This workaround tries to fix it. 36 */ 37 if (!QDesktopServices::storageLocation(QDesktopServices::DataLocation).isEmpty()) { 38 #endif // Q_OS_WINCE_WM 39 return new QSettings(QSettings::IniFormat, QSettings::UserScope, "TSPSG", "tspsg", parent); 40 #ifdef Q_OS_WINCE_WM 41 } else { 42 wchar_t path[MAX_PATH]; 43 SHGetSpecialFolderPath(0, path, 0x001a, FALSE); 44 QString fileName = QString::fromWCharArray(path); 45 fileName.append("\\TSPSG\\tspsg.ini"); 46 return new QSettings(fileName, QSettings::IniFormat, parent); 47 } 48 #endif // Q_OS_WINCE_WM 49 } 50 26 51 #ifndef HANDHELD 27 52 void toggleStyle(QWidget *widget, bool enable) -
src/globals.h
r0784c85e46 r31694c8b58 154 154 } 155 155 156 /*! 157 * \brief Creates QSettings instance with TSPSG-specific options. 158 * \param parent A QObject which will become parent for new QSetting instance. 159 * \return A pointer to new QSettings instance. 160 */ 161 QSettings *initSettings(QObject *parent); 162 156 163 #ifndef HANDHELD 157 164 /*! -
src/main.cpp
r0784c85e46 r31694c8b58 92 92 #ifdef HANDHELD 93 93 mainwindow.showMaximized(); 94 #ifdef Q_OS_WINCE_WM 95 /*! 96 * \hack HACK: For some reason showMaximized() stopped working on 97 * Windows Mobile. This workaround works all the time. 98 */ 99 mainwindow.setWindowState(Qt::WindowMaximized); 100 #endif // Q_OS_WINCE_WM 94 101 #else // HANDHELD 95 102 mainwindow.show(); -
src/mainwindow.cpp
r0784c85e46 r31694c8b58 43 43 : QMainWindow(parent) 44 44 { 45 settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "TSPSG", "tspsg",this);45 settings = initSettings(this); 46 46 47 47 if (settings->contains("Style")) { -
src/settingsdialog.cpp
r0784c85e46 r31694c8b58 234 234 #endif // HANDHELD 235 235 236 settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "TSPSG", "tspsg",this);236 settings = initSettings(this); 237 237 settings->remove("SettingsReset"); 238 238 -
src/tspmodel.cpp
r0784c85e46 r31694c8b58 31 31 : QAbstractTableModel(parent), nCities(0) 32 32 { 33 settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "TSPSG", "tspsg",this);33 settings = initSettings(this); 34 34 } 35 35
Note: See TracChangeset
for help on using the changeset viewer.