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) @@ -1127,7 +1127,6 @@ void Preferences::setMainLastDir(const QString &path)
setValue("MainWindowLastDir", path);
}
#ifndef DISABLE_GUI
QSize Preferences::getPrefSize(const QSize& defaultSize) const
{
return value("Preferences/State/size", defaultSize).toSize();
@ -1137,7 +1136,6 @@ void Preferences::setPrefSize(const QSize &size) @@ -1137,7 +1136,6 @@ void Preferences::setPrefSize(const QSize &size)
{
setValue("Preferences/State/size", size);
}
#endif
QStringList Preferences::getPrefHSplitterSizes() const
{
@ -1209,14 +1207,14 @@ void Preferences::setPropTrackerListState(const QByteArray &state) @@ -1209,14 +1207,14 @@ void Preferences::setPropTrackerListState(const QByteArray &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

7
src/base/preferences.h

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

6
src/gui/rss/automatedrssdownloader.cpp

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

Loading…
Cancel
Save