Throw out unneeded font setters, adapt to ItemViewSettings
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 6 Aug 2009 16:58:57 +0000 (18:58 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 6 Aug 2009 18:25:59 +0000 (20:25 +0200)
src/uisupport/bufferview.cpp
src/uisupport/bufferview.h
src/uisupport/nickview.cpp
src/uisupport/nickview.h

index 8debe24..e477ba1 100644 (file)
@@ -40,7 +40,6 @@
 #include "network.h"
 #include "networkmodel.h"
 #include "contextmenuactionprovider.h"
-#include "uisettings.h"
 
 /*****************************************
 * The TreeView showing the Buffers
@@ -59,10 +58,6 @@ BufferView::BufferView(QWidget *parent)
   BufferViewDelegate *tristateDelegate = new BufferViewDelegate(this);
   setItemDelegate(tristateDelegate);
   delete oldDelegate;
-
-  UiStyleSettings s("QtUiStyle/Fonts"); // li'l dirty here, but fonts are stored in QtUiStyle :/
-  s.notify("BufferView", this, SLOT(setCustomFont(QVariant)));
-  setCustomFont(s.value("BufferView", QFont()));
 }
 
 void BufferView::init() {
@@ -194,13 +189,6 @@ void BufferView::setRootIndexForNetworkId(const NetworkId &networkId) {
   }
 }
 
-void BufferView::setCustomFont(const QVariant &v) {
-  QFont font = v.value<QFont>();
-  if(font.family().isEmpty())
-    font = QApplication::font();
-  setFont(font);
-}
-
 void BufferView::joinChannel(const QModelIndex &index) {
   BufferInfo::Type bufferType = (BufferInfo::Type)index.data(NetworkModel::BufferTypeRole).value<int>();
 
@@ -436,7 +424,7 @@ void BufferView::menuActionTriggered(QAction *result) {
 }
 
 void BufferView::wheelEvent(QWheelEvent* event) {
-  if(UiSettings().value("MouseWheelChangesBuffers", QVariant(true)).toBool() == (bool)(event->modifiers() & Qt::AltModifier))
+  if(ItemViewSettings().mouseWheelChangesBuffer() == (bool)(event->modifiers() & Qt::AltModifier))
     return QTreeView::wheelEvent(event);
 
   int rowDelta = ( event->delta() > 0 ) ? -1 : 1;
index 411cd89..5d19a13 100644 (file)
@@ -83,8 +83,6 @@ private slots:
   void on_configChanged();
   void on_layoutChanged();
 
-  void setCustomFont(const QVariant &font);
-
 private:
   QPointer<BufferViewConfig> _config;
 
index e365474..6d3f398 100644 (file)
@@ -34,7 +34,6 @@
 #include "nickviewfilter.h"
 #include "networkmodel.h"
 #include "types.h"
-#include "uisettings.h"
 
 class ExpandAllEvent : public QEvent {
 public:
@@ -62,10 +61,6 @@ NickView::NickView(QWidget *parent)
   // afaik this is better on Mac and Windows
   connect(this, SIGNAL(activated(QModelIndex)), SLOT(startQuery(QModelIndex)));
 #endif
-
-  UiStyleSettings s("QtUiStyle/Fonts"); // li'l dirty here, but fonts are stored in QtUiStyle :/
-  s.notify("BufferView", this, SLOT(setCustomFont(QVariant))); // yes, we share the BufferView settings
-  setCustomFont(s.value("BufferView", QFont()));
 }
 
 void NickView::init() {
@@ -87,13 +82,6 @@ void NickView::setModel(QAbstractItemModel *model_) {
   init();
 }
 
-void NickView::setCustomFont(const QVariant &v) {
-  QFont font = v.value<QFont>();
-  if(font.family().isEmpty())
-    font = QApplication::font();
-  setFont(font);
-}
-
 void NickView::rowsInserted(const QModelIndex &parent, int start, int end) {
   QTreeView::rowsInserted(parent, start, end);
   if(model()->data(parent, NetworkModel::ItemTypeRole) == NetworkModel::UserCategoryItemType && !isExpanded(parent)) {
index c67a310..e722537 100644 (file)
@@ -45,9 +45,6 @@ public slots:
   void showContextMenu(const QPoint & pos);
   void startQuery(const QModelIndex & modelIndex);
 
-private slots:
-  void setCustomFont(const QVariant &);
-
 signals:
   void selectionUpdated();