From: Manuel Nickschas Date: Thu, 6 Aug 2009 16:58:57 +0000 (+0200) Subject: Throw out unneeded font setters, adapt to ItemViewSettings X-Git-Tag: 0.5-rc1~83 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=df38e82953be7b676871f7215053a005decb90d1;hp=f4c3a241df84e2a2de9ddebdc4c7f25054b4ba9c Throw out unneeded font setters, adapt to ItemViewSettings --- diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index 8debe240..e477ba11 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -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(); - 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(); @@ -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; diff --git a/src/uisupport/bufferview.h b/src/uisupport/bufferview.h index 411cd89b..5d19a138 100644 --- a/src/uisupport/bufferview.h +++ b/src/uisupport/bufferview.h @@ -83,8 +83,6 @@ private slots: void on_configChanged(); void on_layoutChanged(); - void setCustomFont(const QVariant &font); - private: QPointer _config; diff --git a/src/uisupport/nickview.cpp b/src/uisupport/nickview.cpp index e3654741..6d3f3981 100644 --- a/src/uisupport/nickview.cpp +++ b/src/uisupport/nickview.cpp @@ -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(); - 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)) { diff --git a/src/uisupport/nickview.h b/src/uisupport/nickview.h index c67a3104..e722537c 100644 --- a/src/uisupport/nickview.h +++ b/src/uisupport/nickview.h @@ -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();