[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdevplatform/plugins/projectmanagerview
From: Andreas Pakulat <apaku () gmx ! de>
Date: 2009-07-19 0:53:33
Message-ID: 1247964813.995757.1016.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 999036 by apaku:
Revert "Apparently it's not possible to store QVariantList's of QVariantList's in \
KConfig, so let's use just QStringLists and scape them."
Will make the storage in a different way that doesn't need extra
escaping from our side.
M +8 -18 projectbuildsetmodel.cpp
M +2 -2 projectbuildsetmodel.h
--- trunk/KDE/kdevplatform/plugins/projectmanagerview/projectbuildsetmodel.cpp \
#999035:999036 @@ -31,12 +31,9 @@
#include <interfaces/icore.h>
#include <interfaces/iproject.h>
#include <interfaces/iprojectcontroller.h>
+
#include <project/projectmodel.h>
-#include <util/kdevstringhandler.h>
-static QChar pathSeparator='/';
-static QChar pathEscape='\\';
-
BuildItem::BuildItem()
{
}
@@ -74,12 +71,6 @@
return m_itemPath.first();
}
-QStringList BuildItem::itemPath() const
-{
- return m_itemPath;
-}
-
-
KDevelop::ProjectBaseItem* BuildItem::findItem() const
{
KDevelop::ProjectModel* \
model=KDevelop::ICore::self()->projectController()->projectModel(); @@ -122,7 +113,7 \
@@ return m_items.at( idx.row() ).itemName();
break;
case 1:
- return m_items.at( idx.row() ).itemPath().join("/");
+ return m_items.at( idx.row() ).itemPath();
break;
}
} else if(role == Qt::DecorationRole && idx.column()==0) {
@@ -189,7 +180,7 @@
return true;
}
-QList<BuildItem> ProjectBuildSetModel::items() const
+QList<BuildItem> ProjectBuildSetModel::items()
{
return m_items ;
}
@@ -209,13 +200,12 @@
void ProjectBuildSetModel::saveToProject( KDevelop::IProject* project ) const
{
- QStringList paths;
+ QVariantList paths;
foreach( const BuildItem &item, m_items)
{
if( item.itemProject() == project->name() )
- paths.append(KDevStringHandler::joinWithEscaping(item.itemPath(), \
pathSeparator, pathEscape)); + paths.append(item.itemPath());
}
-
KConfigGroup base = project->projectConfiguration()->group("Buildset");
base.writeEntry("BuildItems", paths);
base.sync();
@@ -224,12 +214,12 @@
void ProjectBuildSetModel::loadFromProject( KDevelop::IProject* project )
{
KConfigGroup base = project->projectConfiguration()->group("Buildset");
- QStringList items = base.readEntry("BuildItems", QStringList());
+ QVariantList items = base.readEntry("BuildItems", QVariantList());
- foreach(const QString& path, items)
+ foreach(const QVariant& path, items)
{
beginInsertRows( QModelIndex(), rowCount(), rowCount() );
- m_items.append( BuildItem( KDevStringHandler::splitWithEscaping(path, \
pathSeparator, pathEscape) ) ); + m_items.append( BuildItem( \
path.toStringList() ) ); endInsertRows();
}
}
--- trunk/KDE/kdevplatform/plugins/projectmanagerview/projectbuildsetmodel.h \
#999035:999036 @@ -45,7 +45,7 @@
KDevelop::ProjectBaseItem* findItem() const;
BuildItem& operator=( const BuildItem& );
QString itemName() const;
- QStringList itemPath() const;
+ QStringList itemPath() const { return m_itemPath; }
QString itemProject() const;
private:
QStringList m_itemPath;
@@ -69,7 +69,7 @@
void moveRowsDown( int row, int count );
void moveRowsToTop( int row, int count );
void moveRowsToBottom( int row, int count );
- QList<BuildItem> items() const;
+ QList<BuildItem> items();
public slots:
void saveToProject( KDevelop::IProject* ) const;
void loadFromProject( KDevelop::IProject* );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic