From 8e74eb07383e909b0514fe174ebbde2c837a58ea Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 8 Feb 2010 10:30:49 +0100 Subject: Compile fixes. --- examples/dbus/dbus-chat/chat_adaptor.h | 3 +++ examples/dbus/remotecontrolledcar/car/car_adaptor.h | 3 +++ tools/assistant/tools/assistant/bookmarkitem.cpp | 2 ++ tools/assistant/tools/assistant/bookmarkmodel.cpp | 13 ++++++------- tools/assistant/tools/assistant/cmdlineparser.cpp | 9 ++++----- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/examples/dbus/dbus-chat/chat_adaptor.h b/examples/dbus/dbus-chat/chat_adaptor.h index 831c4f5..47b7f8f 100644 --- a/examples/dbus/dbus-chat/chat_adaptor.h +++ b/examples/dbus/dbus-chat/chat_adaptor.h @@ -54,12 +54,15 @@ #include #include + +QT_BEGIN_NAMESPACE class QByteArray; template class QList; template class QMap; class QString; class QStringList; class QVariant; +QT_END_NAMESPACE /* * Adaptor class for interface com.trolltech.chat diff --git a/examples/dbus/remotecontrolledcar/car/car_adaptor.h b/examples/dbus/remotecontrolledcar/car/car_adaptor.h index d109883..d16972e 100644 --- a/examples/dbus/remotecontrolledcar/car/car_adaptor.h +++ b/examples/dbus/remotecontrolledcar/car/car_adaptor.h @@ -54,12 +54,15 @@ #include #include + +QT_BEGIN_NAMESPACE class QByteArray; template class QList; template class QMap; class QString; class QStringList; class QVariant; +QT_END_NAMESPACE /* * Adaptor class for interface com.trolltech.Examples.CarInterface diff --git a/tools/assistant/tools/assistant/bookmarkitem.cpp b/tools/assistant/tools/assistant/bookmarkitem.cpp index 082ffce..6c3d06c 100644 --- a/tools/assistant/tools/assistant/bookmarkitem.cpp +++ b/tools/assistant/tools/assistant/bookmarkitem.cpp @@ -136,3 +136,5 @@ BookmarkItem::dumpTree(int indent) const foreach (BookmarkItem *item, m_children) item->dumpTree(indent + 4); } + +QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/bookmarkmodel.cpp b/tools/assistant/tools/assistant/bookmarkmodel.cpp index f265ca4..c785f16 100644 --- a/tools/assistant/tools/assistant/bookmarkmodel.cpp +++ b/tools/assistant/tools/assistant/bookmarkmodel.cpp @@ -149,7 +149,7 @@ BookmarkModel::removeItem(const QModelIndex &index) return false; QModelIndexList indexes; - if (index.rowCount() > 0) + if (rowCount(index) > 0) indexes = collectItems(index); indexes.append(index); @@ -220,13 +220,12 @@ BookmarkModel::flags(const QModelIndex &index) const if (m_editable) defaultFlags |= Qt::ItemIsEditable; - if (BookmarkItem *item = itemFromIndex(index)) { - if (index.data(UserRoleFolder).toBool()) { - if (index.column() > 0) - defaultFlags &= ~Qt::ItemIsEditable; - return defaultFlags | Qt::ItemIsDropEnabled; - } + if (itemFromIndex(index) && index.data(UserRoleFolder).toBool() + && index.column() > 0) { + defaultFlags &= ~Qt::ItemIsEditable; + return defaultFlags | Qt::ItemIsDropEnabled; } + return defaultFlags | Qt::ItemIsDragEnabled; } diff --git a/tools/assistant/tools/assistant/cmdlineparser.cpp b/tools/assistant/tools/assistant/cmdlineparser.cpp index b063830..bbc0c37 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.cpp +++ b/tools/assistant/tools/assistant/cmdlineparser.cpp @@ -41,6 +41,7 @@ #include "tracer.h" #include +#include #include #include "cmdlineparser.h" @@ -277,13 +278,11 @@ void CmdLineParser::showMessage(const QString &msg, bool error) if (m_quiet) return; #ifdef Q_OS_WIN - QString s = QLatin1String("
") + msg + QLatin1String("
"); - const QString &message - = QCoreApplication::translate("Assistant", "Qt Assistant"), s); + QString message = QLatin1String("
") % msg % QLatin1String("
"); if (error) - QMessageBox::critical(0, message); + QMessageBox::critical(0, tr("Error"), message); else - QMessageBox::information(0, message); + QMessageBox::information(0, tr("Notice"), message); #else fprintf(error ? stderr : stdout, "%s\n", qPrintable(msg)); #endif -- cgit v0.12