Browse Source

Rename splitter names

adaptive-webui-19844
Chocobo1 8 years ago
parent
commit
a415f14fac
  1. 16
      src/base/preferences.cpp
  2. 8
      src/base/preferences.h
  3. 4
      src/gui/rss/rss.ui
  4. 24
      src/gui/rss/rss_imp.cpp

16
src/base/preferences.cpp

@ -1284,7 +1284,7 @@ void Preferences::setRssOpenFolders(const QStringList &folders)
setValue("Rss/open_folders", folders); setValue("Rss/open_folders", folders);
} }
QByteArray Preferences::getRssHSplitterState() const QByteArray Preferences::getRssSideSplitterState() const
{ {
#ifdef QBT_USES_QT5 #ifdef QBT_USES_QT5
return value("Rss/qt5/splitter_h").toByteArray(); return value("Rss/qt5/splitter_h").toByteArray();
@ -1293,7 +1293,7 @@ QByteArray Preferences::getRssHSplitterState() const
#endif #endif
} }
void Preferences::setRssHSplitterState(const QByteArray &state) void Preferences::setRssSideSplitterState(const QByteArray &state)
{ {
#ifdef QBT_USES_QT5 #ifdef QBT_USES_QT5
setValue("Rss/qt5/splitter_h", state); setValue("Rss/qt5/splitter_h", state);
@ -1302,21 +1302,21 @@ void Preferences::setRssHSplitterState(const QByteArray &state)
#endif #endif
} }
QByteArray Preferences::getRssVSplitterState() const QByteArray Preferences::getRssMainSplitterState() const
{ {
#ifdef QBT_USES_QT5 #ifdef QBT_USES_QT5
return value("Rss/qt5/splitterV").toByteArray(); return value("Rss/qt5/splitterMain").toByteArray();
#else #else
return value("Rss/splitterV").toByteArray(); return value("Rss/splitterMain").toByteArray();
#endif #endif
} }
void Preferences::setRssVSplitterState(const QByteArray &state) void Preferences::setRssMainSplitterState(const QByteArray &state)
{ {
#ifdef QBT_USES_QT5 #ifdef QBT_USES_QT5
setValue("Rss/qt5/splitterV", state); setValue("Rss/qt5/splitterMain", state);
#else #else
setValue("Rss/splitterV", state); setValue("Rss/splitterMain", state);
#endif #endif
} }

8
src/base/preferences.h

@ -300,10 +300,10 @@ public:
void setRssHSplitterSizes(const QByteArray &sizes); void setRssHSplitterSizes(const QByteArray &sizes);
QStringList getRssOpenFolders() const; QStringList getRssOpenFolders() const;
void setRssOpenFolders(const QStringList &folders); void setRssOpenFolders(const QStringList &folders);
QByteArray getRssHSplitterState() const; QByteArray getRssSideSplitterState() const;
void setRssHSplitterState(const QByteArray &state); void setRssSideSplitterState(const QByteArray &state);
QByteArray getRssVSplitterState() const; QByteArray getRssMainSplitterState() const;
void setRssVSplitterState(const QByteArray &state); void setRssMainSplitterState(const QByteArray &state);
QString getSearchColsWidth() const; QString getSearchColsWidth() const;
void setSearchColsWidth(const QString &width); void setSearchColsWidth(const QString &width);
QStringList getSearchEngDisabled() const; QStringList getSearchEngDisabled() const;

4
src/gui/rss/rss.ui

@ -73,7 +73,7 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QSplitter" name="splitter_h"> <widget class="QSplitter" name="splitterSide">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -99,7 +99,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QSplitter" name="splitter_v"> <widget class="QSplitter" name="splitterMain">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>

24
src/gui/rss/rss_imp.cpp

@ -603,20 +603,20 @@ void RSSImp::saveSlidersPosition()
{ {
// Remember sliders positions // Remember sliders positions
Preferences* const pref = Preferences::instance(); Preferences* const pref = Preferences::instance();
pref->setRssHSplitterState(splitter_h->saveState()); pref->setRssSideSplitterState(splitterSide->saveState());
pref->setRssVSplitterState(splitter_v->saveState()); pref->setRssMainSplitterState(splitterMain->saveState());
qDebug("Splitters position saved"); qDebug("Splitters position saved");
} }
void RSSImp::restoreSlidersPosition() void RSSImp::restoreSlidersPosition()
{ {
const Preferences* const pref = Preferences::instance(); const Preferences* const pref = Preferences::instance();
const QByteArray pos_h = pref->getRssHSplitterState(); const QByteArray stateSide = pref->getRssSideSplitterState();
if (!pos_h.isEmpty()) if (!stateSide.isEmpty())
splitter_h->restoreState(pos_h); splitterSide->restoreState(stateSide);
const QByteArray pos_v = pref->getRssVSplitterState(); const QByteArray stateMain = pref->getRssMainSplitterState();
if (!pos_v.isEmpty()) if (!stateMain.isEmpty())
splitter_v->restoreState(pos_v); splitterMain->restoreState(stateMain);
} }
void RSSImp::updateItemsInfos(const QList<QTreeWidgetItem*>& items) void RSSImp::updateItemsInfos(const QList<QTreeWidgetItem*>& items)
@ -704,8 +704,8 @@ RSSImp::RSSImp(QWidget *parent):
rssDownloaderBtn->setIcon(GuiIconProvider::instance()->getIcon("download")); rssDownloaderBtn->setIcon(GuiIconProvider::instance()->getIcon("download"));
settingsButton->setIcon(GuiIconProvider::instance()->getIcon("preferences-system")); settingsButton->setIcon(GuiIconProvider::instance()->getIcon("preferences-system"));
m_feedList = new FeedListWidget(splitter_h, m_rssManager); m_feedList = new FeedListWidget(splitterSide, m_rssManager);
splitter_h->insertWidget(0, m_feedList); splitterSide->insertWidget(0, m_feedList);
editHotkey = new QShortcut(QKeySequence("F2"), m_feedList, 0, 0, Qt::WidgetShortcut); editHotkey = new QShortcut(QKeySequence("F2"), m_feedList, 0, 0, Qt::WidgetShortcut);
connect(editHotkey, SIGNAL(activated()), SLOT(renameSelectedRssFile())); connect(editHotkey, SIGNAL(activated()), SLOT(renameSelectedRssFile()));
connect(m_feedList, SIGNAL(doubleClicked(QModelIndex)), SLOT(renameSelectedRssFile())); connect(m_feedList, SIGNAL(doubleClicked(QModelIndex)), SLOT(renameSelectedRssFile()));
@ -747,8 +747,8 @@ RSSImp::RSSImp(QWidget *parent):
// Restore sliders position // Restore sliders position
restoreSlidersPosition(); restoreSlidersPosition();
// Bind saveSliders slots // Bind saveSliders slots
connect(splitter_v, SIGNAL(splitterMoved(int, int)), this, SLOT(saveSlidersPosition())); connect(splitterMain, SIGNAL(splitterMoved(int, int)), this, SLOT(saveSlidersPosition()));
connect(splitter_h, SIGNAL(splitterMoved(int, int)), this, SLOT(saveSlidersPosition())); connect(splitterSide, SIGNAL(splitterMoved(int, int)), this, SLOT(saveSlidersPosition()));
qDebug("RSSImp constructed"); qDebug("RSSImp constructed");
} }

Loading…
Cancel
Save