1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 07:18:08 +00:00

Save widget states under different paths when using Qt5. Closes #2340.

This commit is contained in:
sledgehammer999 2015-04-05 20:49:26 +03:00
parent 4612abb41e
commit dcc73afd73

View File

@ -1891,12 +1891,20 @@ void Preferences::setTrayIconStyle(TrayIcon::Style style)
// in the same file.
QByteArray Preferences::getAddNewTorrentDialogState() const
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
return value("AddNewTorrentDialog/qt5/treeHeaderState").toByteArray();
#else
return value("AddNewTorrentDialog/treeHeaderState").toByteArray();
#endif
}
void Preferences::setAddNewTorrentDialogState(const QByteArray &state)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
setValue("AddNewTorrentDialog/qt5/treeHeaderState", state);
#else
setValue("AddNewTorrentDialog/treeHeaderState", state);
#endif
}
int Preferences::getAddNewTorrentDialogPos() const
@ -1981,12 +1989,20 @@ void Preferences::setMainGeometry(const QByteArray &geometry)
QByteArray Preferences::getMainVSplitterState() const
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
return value("MainWindow/qt5/vsplitterState").toByteArray();
#else
return value("MainWindow/vsplitterState").toByteArray();
#endif
}
void Preferences::setMainVSplitterState(const QByteArray &state)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
setValue("MainWindow/qt5/vsplitterState", state);
#else
setValue("MainWindow/vsplitterState", state);
#endif
}
QString Preferences::getMainLastDir() const
@ -2033,12 +2049,20 @@ void Preferences::setPrefHSplitterSizes(const QStringList &sizes)
QByteArray Preferences::getPeerListState() const
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
return value("TorrentProperties/Peers/qt5/PeerListState").toByteArray();
#else
return value("TorrentProperties/Peers/PeerListState").toByteArray();
#endif
}
void Preferences::setPeerListState(const QByteArray &state)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
setValue("TorrentProperties/Peers/qt5/PeerListState", state);
#else
setValue("TorrentProperties/Peers/PeerListState", state);
#endif
}
QString Preferences::getPropSplitterSizes() const
@ -2053,12 +2077,20 @@ void Preferences::setPropSplitterSizes(const QString &sizes)
QByteArray Preferences::getPropFileListState() const
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
return value("TorrentProperties/qt5/FilesListState").toByteArray();
#else
return value("TorrentProperties/FilesListState").toByteArray();
#endif
}
void Preferences::setPropFileListState(const QByteArray &state)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
setValue("TorrentProperties/qt5/FilesListState", state);
#else
setValue("TorrentProperties/FilesListState", state);
#endif
}
int Preferences::getPropCurTab() const
@ -2083,12 +2115,20 @@ void Preferences::setPropVisible(const bool visible)
QByteArray Preferences::getPropTrackerListState() const
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
return value("TorrentProperties/Trackers/qt5/TrackerListState").toByteArray();
#else
return value("TorrentProperties/Trackers/TrackerListState").toByteArray();
#endif
}
void Preferences::setPropTrackerListState(const QByteArray &state)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
setValue("TorrentProperties/Trackers/qt5/TrackerListState", state);
#else
setValue("TorrentProperties/Trackers/TrackerListState", state);
#endif
}
QByteArray Preferences::getRssGeometry() const
@ -2103,12 +2143,20 @@ void Preferences::setRssGeometry(const QByteArray &geometry)
QByteArray Preferences::getRssHSplitterSizes() const
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
return value("RssFeedDownloader/qt5/hsplitterSizes").toByteArray();
#else
return value("RssFeedDownloader/hsplitterSizes").toByteArray();
#endif
}
void Preferences::setRssHSplitterSizes(const QByteArray &sizes)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
setValue("RssFeedDownloader/qt5/hsplitterSizes", sizes);
#else
setValue("RssFeedDownloader/hsplitterSizes", sizes);
#endif
}
QStringList Preferences::getRssOpenFolders() const
@ -2123,22 +2171,38 @@ void Preferences::setRssOpenFolders(const QStringList &folders)
QByteArray Preferences::getRssHSplitterState() const
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
return value("rss/qt5/splitter_h").toByteArray();
#else
return value("rss/splitter_h").toByteArray();
#endif
}
void Preferences::setRssHSplitterState(const QByteArray &state)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
setValue("rss/qt5/splitter_h", state);
#else
setValue("rss/splitter_h", state);
#endif
}
QByteArray Preferences::getRssVSplitterState() const
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
return value("rss/qt5/splitter_v").toByteArray();
#else
return value("rss/splitter_v").toByteArray();
#endif
}
void Preferences::setRssVSplitterState(const QByteArray &state)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
setValue("rss/qt5/splitter_v", state);
#else
setValue("rss/splitter_v", state);
#endif
}
QString Preferences::getSearchColsWidth() const
@ -2273,12 +2337,20 @@ void Preferences::setTransSelFilter(const int &index)
QByteArray Preferences::getTransHeaderState() const
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
return value("TransferList/qt5/HeaderState").toByteArray();
#else
return value("TransferList/HeaderState").toByteArray();
#endif
}
void Preferences::setTransHeaderState(const QByteArray &state)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
setValue("TransferList/qt5/HeaderState", state);
#else
setValue("TransferList/HeaderState", state);
#endif
}
// Temp code.