Browse Source

Fix automatedrssdownloader position

adaptive-webui-19844
Chocobo1 9 years ago
parent
commit
2258e4d5ed
  1. 10
      src/base/preferences.cpp
  2. 7
      src/base/preferences.h
  3. 6
      src/gui/rss/automatedrssdownloader.cpp

10
src/base/preferences.cpp

@ -1127,7 +1127,6 @@ void Preferences::setMainLastDir(const QString &path)
setValue("MainWindowLastDir", path); setValue("MainWindowLastDir", path);
} }
#ifndef DISABLE_GUI
QSize Preferences::getPrefSize(const QSize& defaultSize) const QSize Preferences::getPrefSize(const QSize& defaultSize) const
{ {
return value("Preferences/State/size", defaultSize).toSize(); return value("Preferences/State/size", defaultSize).toSize();
@ -1137,7 +1136,6 @@ void Preferences::setPrefSize(const QSize &size)
{ {
setValue("Preferences/State/size", size); setValue("Preferences/State/size", size);
} }
#endif
QStringList Preferences::getPrefHSplitterSizes() const QStringList Preferences::getPrefHSplitterSizes() const
{ {
@ -1209,14 +1207,14 @@ void Preferences::setPropTrackerListState(const QByteArray &state)
setValue("TorrentProperties/Trackers/qt5/TrackerListState", state); setValue("TorrentProperties/Trackers/qt5/TrackerListState", state);
} }
QByteArray Preferences::getRssGeometry() const QSize Preferences::getRssGeometrySize(const QSize &defaultSize) const
{ {
return value("RssFeedDownloader/geometry").toByteArray(); return value("RssFeedDownloader/geometrySize", defaultSize).toSize();
} }
void Preferences::setRssGeometry(const QByteArray &geometry) void Preferences::setRssGeometrySize(const QSize &geometry)
{ {
setValue("RssFeedDownloader/geometry", geometry); setValue("RssFeedDownloader/geometrySize", geometry);
} }
QByteArray Preferences::getRssHSplitterSizes() const QByteArray Preferences::getRssHSplitterSizes() const

7
src/base/preferences.h

@ -36,6 +36,7 @@
#include <QTime> #include <QTime>
#include <QDateTime> #include <QDateTime>
#include <QList> #include <QList>
#include <QSize>
#include <QTimer> #include <QTimer>
#include <QReadWriteLock> #include <QReadWriteLock>
#include <QNetworkCookie> #include <QNetworkCookie>
@ -274,10 +275,8 @@ public:
void setMainVSplitterState(const QByteArray &state); void setMainVSplitterState(const QByteArray &state);
QString getMainLastDir() const; QString getMainLastDir() const;
void setMainLastDir(const QString &path); void setMainLastDir(const QString &path);
#ifndef DISABLE_GUI
QSize getPrefSize(const QSize &defaultSize) const; QSize getPrefSize(const QSize &defaultSize) const;
void setPrefSize(const QSize &size); void setPrefSize(const QSize &size);
#endif
QStringList getPrefHSplitterSizes() const; QStringList getPrefHSplitterSizes() const;
void setPrefHSplitterSizes(const QStringList &sizes); void setPrefHSplitterSizes(const QStringList &sizes);
QByteArray getPeerListState() const; QByteArray getPeerListState() const;
@ -292,8 +291,8 @@ public:
void setPropVisible(const bool visible); void setPropVisible(const bool visible);
QByteArray getPropTrackerListState() const; QByteArray getPropTrackerListState() const;
void setPropTrackerListState(const QByteArray &state); void setPropTrackerListState(const QByteArray &state);
QByteArray getRssGeometry() const; QSize getRssGeometrySize(const QSize &defaultSize) const;
void setRssGeometry(const QByteArray &geometry); void setRssGeometrySize(const QSize &geometry);
QByteArray getRssHSplitterSizes() const; QByteArray getRssHSplitterSizes() const;
void setRssHSplitterSizes(const QByteArray &sizes); void setRssHSplitterSizes(const QByteArray &sizes);
QStringList getRssOpenFolders() const; QStringList getRssOpenFolders() const;

6
src/gui/rss/automatedrssdownloader.cpp

@ -149,17 +149,15 @@ AutomatedRssDownloader::~AutomatedRssDownloader()
void AutomatedRssDownloader::loadSettings() void AutomatedRssDownloader::loadSettings()
{ {
// load dialog geometry
const Preferences *const pref = Preferences::instance(); const Preferences *const pref = Preferences::instance();
restoreGeometry(pref->getRssGeometry()); resize(pref->getRssGeometrySize(this->size()));
m_ui->hsplitter->restoreState(pref->getRssHSplitterSizes()); m_ui->hsplitter->restoreState(pref->getRssHSplitterSizes());
} }
void AutomatedRssDownloader::saveSettings() void AutomatedRssDownloader::saveSettings()
{ {
// Save dialog geometry
Preferences *const pref = Preferences::instance(); Preferences *const pref = Preferences::instance();
pref->setRssGeometry(saveGeometry()); pref->setRssGeometrySize(this->size());
pref->setRssHSplitterSizes(m_ui->hsplitter->saveState()); pref->setRssHSplitterSizes(m_ui->hsplitter->saveState());
} }

Loading…
Cancel
Save