Port xconfig to Qt5 - Use QList

Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
This commit is contained in:
Boris Barbulovski 2015-09-22 11:36:05 -07:00 committed by Michal Marek
parent bea00771f7
commit 041fbdc21f
2 changed files with 9 additions and 9 deletions

View File

@ -7,7 +7,7 @@
#include <QMainWindow> #include <QMainWindow>
#include <q3vbox.h> #include <q3vbox.h>
#include <q3valuelist.h> #include <QList>
#include <q3textbrowser.h> #include <q3textbrowser.h>
#include <QAction> #include <QAction>
#include <q3header.h> #include <q3header.h>
@ -64,9 +64,9 @@ ConfigSettings::ConfigSettings()
/** /**
* Reads a list of integer values from the application settings. * Reads a list of integer values from the application settings.
*/ */
Q3ValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok) QList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
{ {
Q3ValueList<int> result; QList<int> result;
QStringList entryList = readListEntry(key, ok); QStringList entryList = readListEntry(key, ok);
QStringList::Iterator it; QStringList::Iterator it;
@ -79,10 +79,10 @@ Q3ValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
/** /**
* Writes a list of integer values to the application settings. * Writes a list of integer values to the application settings.
*/ */
bool ConfigSettings::writeSizes(const QString& key, const Q3ValueList<int>& value) bool ConfigSettings::writeSizes(const QString& key, const QList<int>& value)
{ {
QStringList stringList; QStringList stringList;
Q3ValueList<int>::ConstIterator it; QList<int>::ConstIterator it;
for (it = value.begin(); it != value.end(); ++it) for (it = value.begin(); it != value.end(); ++it)
stringList.push_back(QString::number(*it)); stringList.push_back(QString::number(*it));
@ -1214,7 +1214,7 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
y = configSettings->readNumEntry("/window y", 0, &ok); y = configSettings->readNumEntry("/window y", 0, &ok);
if (ok) if (ok)
move(x, y); move(x, y);
Q3ValueList<int> sizes = configSettings->readSizes("/split", &ok); QList<int> sizes = configSettings->readSizes("/split", &ok);
if (ok) if (ok)
split->setSizes(sizes); split->setSizes(sizes);
configSettings->endGroup(); configSettings->endGroup();
@ -1446,7 +1446,7 @@ ConfigMainWindow::ConfigMainWindow(void)
showSplitView(); showSplitView();
// UI setup done, restore splitter positions // UI setup done, restore splitter positions
Q3ValueList<int> sizes = configSettings->readSizes("/split1", &ok); QList<int> sizes = configSettings->readSizes("/split1", &ok);
if (ok) if (ok)
split1->setSizes(sizes); split1->setSizes(sizes);

View File

@ -16,8 +16,8 @@ class ConfigMainWindow;
class ConfigSettings : public QSettings { class ConfigSettings : public QSettings {
public: public:
ConfigSettings(); ConfigSettings();
Q3ValueList<int> readSizes(const QString& key, bool *ok); QList<int> readSizes(const QString& key, bool *ok);
bool writeSizes(const QString& key, const Q3ValueList<int>& value); bool writeSizes(const QString& key, const QList<int>& value);
}; };
enum colIdx { enum colIdx {