Fix profiles not found

master
addi 2016-06-22 15:30:32 +02:00
parent d8fce4e823
commit 0a9f8556f5
3 changed files with 43 additions and 47 deletions

View File

@ -736,7 +736,7 @@
<location filename="../mainwindow.ui" line="1266"/>
<location filename="../mainwindow.ui" line="1277"/>
<location filename="../mainwindow.ui" line="1288"/>
<location filename="../mainwindow.cpp" line="946"/>
<location filename="../mainwindow.cpp" line="942"/>
<source>select color</source>
<translation>Farbe auswählen</translation>
</message>
@ -892,7 +892,7 @@
</message>
<message>
<location filename="../mainwindow.ui" line="2397"/>
<location filename="../mainwindow.cpp" line="927"/>
<location filename="../mainwindow.cpp" line="923"/>
<source>About MinetestMapper</source>
<translation>Über MinetestMapper</translation>
</message>
@ -941,7 +941,7 @@
</message>
<message>
<location filename="../mainwindow.ui" line="2537"/>
<location filename="../mainwindow.cpp" line="959"/>
<location filename="../mainwindow.cpp" line="955"/>
<source>New Profile</source>
<translation>Neues Profil</translation>
</message>
@ -972,7 +972,7 @@
</message>
<message>
<location filename="../mainwindow.ui" line="2496"/>
<location filename="../mainwindow.cpp" line="913"/>
<location filename="../mainwindow.cpp" line="909"/>
<source>About MinetestMapper GUI</source>
<translation>Über MinetestMapperGUI</translation>
</message>
@ -1128,69 +1128,69 @@ Die einzelnen Parameter können entfernt, verändert, oder neue hinzugefügt wer
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="871"/>
<location filename="../mainwindow.cpp" line="867"/>
<source>Open Minetest World</source>
<translation>Minetest Welt-Ordner öffnen</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="881"/>
<location filename="../mainwindow.cpp" line="877"/>
<source>Save generated map to...</source>
<translation>Karte speichern nach...</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="881"/>
<location filename="../mainwindow.cpp" line="877"/>
<source>png image (*.png)</source>
<translation>png Grafik (*.png)</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="888"/>
<location filename="../mainwindow.cpp" line="884"/>
<source>Open HeightmapNodes File</source>
<translation>Öffne HeightmapNodes Datei</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="890"/>
<location filename="../mainwindow.cpp" line="898"/>
<location filename="../mainwindow.cpp" line="906"/>
<location filename="../mainwindow.cpp" line="886"/>
<location filename="../mainwindow.cpp" line="894"/>
<location filename="../mainwindow.cpp" line="902"/>
<source>TXT File (*.txt)</source>
<translation>TXT Datei (*.txt)</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="896"/>
<location filename="../mainwindow.cpp" line="892"/>
<source>Open HeightmapColors File</source>
<translation>Öffne Höhenkarte Farbdefinitionsdatei</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="904"/>
<location filename="../mainwindow.cpp" line="900"/>
<source>Open colors.txt File</source>
<translation>Öffne colors.txt Datei</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="914"/>
<location filename="../mainwindow.cpp" line="910"/>
<source>&lt;h1&gt;About MinetestMapperGUI&lt;/h1&gt;The &lt;b&gt;MinetestMapper Gui&lt;/b&gt; is written by addi.&lt;br /&gt;It is licensed under a &lt;a href=&quot;http://creativecommons.org/licenses/by/3.0/&quot;&gt;Creative Commons Attribution 3.0 Unported License&lt;/a&gt;.&lt;br&gt;The current version is %1. &lt;br&gt;The sourcecode is aviable on &lt;a href=&apos;https://bitbucket.org/adrido/minetestmappergui/&apos;&gt;Bitbucket&lt;/a&gt;.&lt;br&gt;You may also want to read the &lt;a href=&apos;https://forum.minetest.net/viewtopic.php?f=14&amp;t=12139&apos;&gt;Minetest forum thread&lt;/a&gt;.&lt;br&gt;&lt;br&gt;&lt;b&gt;Thanks to:&lt;/b&gt;&lt;br&gt;McKrustenkaese for his great icon</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1019"/>
<location filename="../mainwindow.cpp" line="1015"/>
<source>map center</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1024"/>
<location filename="../mainwindow.cpp" line="1020"/>
<source>map origin (top left)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="928"/>
<location filename="../mainwindow.cpp" line="924"/>
<source>&lt;h1&gt;About MinetestMapper&lt;/h1&gt;The &lt;b&gt;MinetestMapper&lt;/b&gt; is written by:&lt;br&gt;Miroslav Bendík &lt;miroslav.bendik@gmail.com&gt;&lt;br&gt;ShadowNinja &lt;shadowninja@minetest.net&gt;&lt;br&gt;sfan5 &lt;sfan5@live.de&gt;&lt;br&gt;Rogier &lt;rogier777@gmail.com&gt;&lt;br&gt;&lt;br&gt;&lt;u&gt;License:&lt;/u&gt;LGPLv2.1+ and BSD 2-clause.&lt;br&gt;&lt;u&gt;Source Code:&lt;/u&gt; &lt;a href=&apos;https://github.com/Rogier-5/minetest-mapper-cpp&apos;&gt;Github&lt;/a&gt;&lt;br&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="940"/>
<location filename="../mainwindow.cpp" line="936"/>
<source>preview: %1</source>
<translation>Vorschau: %1</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="960"/>
<location filename="../mainwindow.cpp" line="956"/>
<source>Name of the new Profile:</source>
<translation>Name des Neuen Profils:</translation>
</message>

View File

@ -432,7 +432,7 @@
<location filename="../mainwindow.ui" line="1266"/>
<location filename="../mainwindow.ui" line="1277"/>
<location filename="../mainwindow.ui" line="1288"/>
<location filename="../mainwindow.cpp" line="946"/>
<location filename="../mainwindow.cpp" line="942"/>
<source>select color</source>
<translation type="unfinished"></translation>
</message>
@ -851,7 +851,7 @@
</message>
<message>
<location filename="../mainwindow.ui" line="2397"/>
<location filename="../mainwindow.cpp" line="927"/>
<location filename="../mainwindow.cpp" line="923"/>
<source>About MinetestMapper</source>
<translation type="unfinished"></translation>
</message>
@ -897,7 +897,7 @@
</message>
<message>
<location filename="../mainwindow.ui" line="2496"/>
<location filename="../mainwindow.cpp" line="913"/>
<location filename="../mainwindow.cpp" line="909"/>
<source>About MinetestMapper GUI</source>
<translation type="unfinished"></translation>
</message>
@ -921,7 +921,7 @@
</message>
<message>
<location filename="../mainwindow.ui" line="2537"/>
<location filename="../mainwindow.cpp" line="959"/>
<location filename="../mainwindow.cpp" line="955"/>
<source>New Profile</source>
<translation type="unfinished"></translation>
</message>
@ -1097,69 +1097,69 @@ The arguments can be removed, modified, or new arguments can be added.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="871"/>
<location filename="../mainwindow.cpp" line="867"/>
<source>Open Minetest World</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="881"/>
<location filename="../mainwindow.cpp" line="877"/>
<source>Save generated map to...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="881"/>
<location filename="../mainwindow.cpp" line="877"/>
<source>png image (*.png)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="888"/>
<location filename="../mainwindow.cpp" line="884"/>
<source>Open HeightmapNodes File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="890"/>
<location filename="../mainwindow.cpp" line="898"/>
<location filename="../mainwindow.cpp" line="906"/>
<location filename="../mainwindow.cpp" line="886"/>
<location filename="../mainwindow.cpp" line="894"/>
<location filename="../mainwindow.cpp" line="902"/>
<source>TXT File (*.txt)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="896"/>
<location filename="../mainwindow.cpp" line="892"/>
<source>Open HeightmapColors File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="904"/>
<location filename="../mainwindow.cpp" line="900"/>
<source>Open colors.txt File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="914"/>
<location filename="../mainwindow.cpp" line="910"/>
<source>&lt;h1&gt;About MinetestMapperGUI&lt;/h1&gt;The &lt;b&gt;MinetestMapper Gui&lt;/b&gt; is written by addi.&lt;br /&gt;It is licensed under a &lt;a href=&quot;http://creativecommons.org/licenses/by/3.0/&quot;&gt;Creative Commons Attribution 3.0 Unported License&lt;/a&gt;.&lt;br&gt;The current version is %1. &lt;br&gt;The sourcecode is aviable on &lt;a href=&apos;https://bitbucket.org/adrido/minetestmappergui/&apos;&gt;Bitbucket&lt;/a&gt;.&lt;br&gt;You may also want to read the &lt;a href=&apos;https://forum.minetest.net/viewtopic.php?f=14&amp;t=12139&apos;&gt;Minetest forum thread&lt;/a&gt;.&lt;br&gt;&lt;br&gt;&lt;b&gt;Thanks to:&lt;/b&gt;&lt;br&gt;McKrustenkaese for his great icon</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1019"/>
<location filename="../mainwindow.cpp" line="1015"/>
<source>map center</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1024"/>
<location filename="../mainwindow.cpp" line="1020"/>
<source>map origin (top left)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="928"/>
<location filename="../mainwindow.cpp" line="924"/>
<source>&lt;h1&gt;About MinetestMapper&lt;/h1&gt;The &lt;b&gt;MinetestMapper&lt;/b&gt; is written by:&lt;br&gt;Miroslav Bendík &lt;miroslav.bendik@gmail.com&gt;&lt;br&gt;ShadowNinja &lt;shadowninja@minetest.net&gt;&lt;br&gt;sfan5 &lt;sfan5@live.de&gt;&lt;br&gt;Rogier &lt;rogier777@gmail.com&gt;&lt;br&gt;&lt;br&gt;&lt;u&gt;License:&lt;/u&gt;LGPLv2.1+ and BSD 2-clause.&lt;br&gt;&lt;u&gt;Source Code:&lt;/u&gt; &lt;a href=&apos;https://github.com/Rogier-5/minetest-mapper-cpp&apos;&gt;Github&lt;/a&gt;&lt;br&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="940"/>
<location filename="../mainwindow.cpp" line="936"/>
<source>preview: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="960"/>
<location filename="../mainwindow.cpp" line="956"/>
<source>Name of the new Profile:</source>
<translation type="unfinished"></translation>
</message>

View File

@ -629,16 +629,12 @@ void MainWindow::createProfilesMenu(){
connect(profileGroup, SIGNAL (triggered(QAction *)), this, SLOT (slotProfileChanged(QAction *)));
#if QT_VERSION >=0x050500
//if using Qt version >= 5.5.0;
QDir dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation).append("/profiles/"));
#else
//Qt 5.4 or less
QSettings dummySettings(QSettings::IniFormat, QSettings::UserScope,QCoreApplication::organizationName(),"/profiles/default");
//Qt 5.4 or less
QSettings dummySettings(QSettings::IniFormat, QSettings::UserScope,QCoreApplication::organizationName(),"/profiles/default");
QDir dir = QFileInfo(dummySettings.fileName()).absoluteDir();
QDir dir = QFileInfo(dummySettings.fileName()).absoluteDir();
#endif
QStringList fileNames = dir.entryList(QStringList("*.ini"));
qDebug()<<"found the Profiles"<< fileNames<< "in"<<dir.absolutePath();
@ -669,7 +665,7 @@ void MainWindow::createProfilesMenu(){
void MainWindow::slotProfileChanged(QAction* action)
{
if(action != 0) {
//writeProfile(currentProfile);
writeProfile(currentProfile);
currentProfile = action->data().toString();
readProfile(currentProfile);
}