From 9fd43b8bc40e3b7657dc7eba2dccff95f0d0077a Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 7 Jan 2011 14:03:52 +0100 Subject: Assistant: Fix warnings. --- .../tools/assistant/bookmarkfiltermodel.cpp | 37 +++++++++++----------- tools/assistant/tools/assistant/mainwindow.cpp | 5 +-- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/tools/assistant/tools/assistant/bookmarkfiltermodel.cpp b/tools/assistant/tools/assistant/bookmarkfiltermodel.cpp index fe510a5..d60e537 100644 --- a/tools/assistant/tools/assistant/bookmarkfiltermodel.cpp +++ b/tools/assistant/tools/assistant/bookmarkfiltermodel.cpp @@ -54,25 +54,24 @@ void BookmarkFilterModel::setSourceModel(QAbstractItemModel *_sourceModel) { beginResetModel(); - disconnect(sourceModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, - SLOT(changed(QModelIndex, QModelIndex))); - - disconnect(sourceModel, SIGNAL(rowsInserted(QModelIndex, int, int)), - this, SLOT(rowsInserted(QModelIndex, int, int))); - - disconnect(sourceModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), - this, SLOT(rowsAboutToBeRemoved(QModelIndex, int, int))); - disconnect(sourceModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, - SLOT(rowsRemoved(QModelIndex, int, int))); - - disconnect(sourceModel, SIGNAL(layoutAboutToBeChanged()), this, - SLOT(layoutAboutToBeChanged())); - disconnect(sourceModel, SIGNAL(layoutChanged()), this, - SLOT(layoutChanged())); - - disconnect(sourceModel, SIGNAL(modelAboutToBeReset()), this, - SLOT(modelAboutToBeReset())); - disconnect(sourceModel, SIGNAL(modelReset()), this, SLOT(modelReset())); + if (sourceModel) { + disconnect(sourceModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), + this, SLOT(changed(QModelIndex, QModelIndex))); + disconnect(sourceModel, SIGNAL(rowsInserted(QModelIndex, int, int)), + this, SLOT(rowsInserted(QModelIndex, int, int))); + disconnect(sourceModel, + SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), this, + SLOT(rowsAboutToBeRemoved(QModelIndex, int, int))); + disconnect(sourceModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), + this, SLOT(rowsRemoved(QModelIndex, int, int))); + disconnect(sourceModel, SIGNAL(layoutAboutToBeChanged()), this, + SLOT(layoutAboutToBeChanged())); + disconnect(sourceModel, SIGNAL(layoutChanged()), this, + SLOT(layoutChanged())); + disconnect(sourceModel, SIGNAL(modelAboutToBeReset()), this, + SLOT(modelAboutToBeReset())); + disconnect(sourceModel, SIGNAL(modelReset()), this, SLOT(modelReset())); + } QAbstractProxyModel::setSourceModel(sourceModel); sourceModel = qobject_cast (_sourceModel); diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index d6b9e24..7852104 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -199,6 +199,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) } QToolBar *toolBar = addToolBar(tr("Bookmark Toolbar")); + toolBar->setObjectName(QLatin1String("Bookmark Toolbar")); bookMarkManager->setBookmarksToolbar(toolBar); // Show the widget here, otherwise the restore geometry and state won't work @@ -459,10 +460,6 @@ void MainWindow::setupActions() menu->addAction(globalActions->printAction()); menu->addSeparator(); - m_closeTabAction = menu->addAction(tr("&Close Tab"), m_centralWidget, - SLOT(closeTab())); - m_closeTabAction->setShortcuts(QKeySequence::Close); - QIcon appExitIcon = QIcon::fromTheme("application-exit"); QAction *tmp; #ifdef Q_OS_WIN -- cgit v0.12