From 33f868144b6824d55c6d35fa67efeaba4b0e5ef9 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 28 Feb 2010 16:00:52 +0000 Subject: [PATCH] Use a regular pointer instead of a QSharedPointer to fix Qt 4.4 compatibility --- src/scannedfoldersmodel.cpp | 8 ++++---- src/scannedfoldersmodel.h | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/scannedfoldersmodel.cpp b/src/scannedfoldersmodel.cpp index d706ff321..a1928952a 100644 --- a/src/scannedfoldersmodel.cpp +++ b/src/scannedfoldersmodel.cpp @@ -76,7 +76,7 @@ QVariant ScanFoldersModel::data(const QModelIndex &index, int role) const { if (!index.isValid() || index.row() >= rowCount()) return QVariant(); - const QSharedPointer &pathData = m_pathList.at(index.row()); + const PathData* pathData = m_pathList.at(index.row()); if (index.column() == PathColumn && role == Qt::DisplayRole) return pathData->path; if (index.column() == DownloadAtTorrentColumn && role == Qt::CheckStateRole) @@ -122,7 +122,7 @@ ScanFoldersModel::PathStatus ScanFoldersModel::addPath(const QString &path) { connect(m_fsWatcher, SIGNAL(torrentsAdded(QStringList&)), this, SIGNAL(torrentsAdded(QStringList&))); } beginInsertRows(QModelIndex(), rowCount(), rowCount()); - m_pathList << QSharedPointer(new PathData(canonicalPath)); + m_pathList << new PathData(canonicalPath); endInsertRows(); m_fsWatcher->addPath(canonicalPath); return Ok; @@ -169,7 +169,7 @@ bool ScanFoldersModel::downloadInTorrentFolder(const QString &filePath) const { int ScanFoldersModel::findPathData(const QString &path) const { for (int i = 0; i < m_pathList.count(); ++i) { - const QSharedPointer &pathData = m_pathList.at(i); + const PathData* pathData = m_pathList.at(i); if (pathData->path == path) return i; } @@ -180,7 +180,7 @@ int ScanFoldersModel::findPathData(const QString &path) const { void ScanFoldersModel::makePersistent(QSettings &settings) { QStringList paths; QList downloadInFolderInfo; - foreach (const QSharedPointer &pathData, m_pathList) { + foreach (const PathData* pathData, m_pathList) { paths << pathData->path; downloadInFolderInfo << pathData->downloadAtPath; } diff --git a/src/scannedfoldersmodel.h b/src/scannedfoldersmodel.h index 5234b6a01..9352532ac 100644 --- a/src/scannedfoldersmodel.h +++ b/src/scannedfoldersmodel.h @@ -33,7 +33,6 @@ #include #include -#include #include class FileSystemWatcher; @@ -75,7 +74,7 @@ private: class PathData; int findPathData(const QString &path) const; - QList > m_pathList; + QList m_pathList; FileSystemWatcher *m_fsWatcher; };