- Timestamp:
- Jun 30, 2009, 7:14:52 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/main.cpp
r31 r33 27 27 { 28 28 QApplication app(argc, argv); 29 QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf8")); 30 QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf8")); 31 QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8")); 29 32 app.setOrganizationName("..::Lёppsville::.."); 30 33 app.setOrganizationDomain("www.leppsville.com"); 31 34 app.setApplicationName("TSPSG"); 32 QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));33 35 MainWindow mainwindow; 34 36 mainwindow.show(); -
trunk/src/mainwindow.cpp
r31 r33 196 196 { 197 197 QPrintDialog pd(printer,this); 198 #if QT_VERSION >= 0x040500 199 // No such methods in Qt < 4.5 198 200 pd.setOption(QAbstractPrintDialog::PrintSelection,false); 199 201 pd.setOption(QAbstractPrintDialog::PrintPageRange,false); 202 #endif 200 203 pd.exec(); 201 204 } … … 253 256 { 254 257 QSettings langinfo("i18n/languages.ini",QSettings::IniFormat); 258 #if QT_VERSION >= 0x040500 259 // In Qt < 4.5 QSettings doesn't have method setIniCodec. 255 260 langinfo.setIniCodec("UTF-8"); 261 #endif 256 262 QDir dir("i18n","*.qm",QDir::Name | QDir::IgnoreCase,QDir::Files); 257 263 if (!dir.exists()) … … 264 270 QFileInfo lang = langs.at(k); 265 271 if (!lang.completeBaseName().startsWith("qt_") && lang.completeBaseName().compare("en")) { 272 #if QT_VERSION >= 0x040500 266 273 a = menuSettingsLanguage->addAction(langinfo.value(lang.completeBaseName() + "/NativeName",lang.completeBaseName()).toString()); 274 #else 275 // We use Name if Qt < 4.5 because NativeName is in UTF-8, QSettings 276 // reads .ini file as ASCII and there is no way to set file encoding. 277 a = menuSettingsLanguage->addAction(langinfo.value(lang.completeBaseName() + "/Name",lang.completeBaseName()).toString()); 278 #endif 267 279 a->setData(lang.completeBaseName()); 268 280 a->setCheckable(true); -
trunk/tspsg.pri
r32 r33 21 21 22 22 #Source files 23 SOURCES += ./src/main.cpp \23 SOURCES += src/main.cpp \ 24 24 src/mainwindow.cpp \ 25 25 src/settingsdialog.cpp \
Note: See TracChangeset
for help on using the changeset viewer.