[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdewebdev/quanta/plugins/project/projectfilemanager
From: Andreas Pakulat <apaku () gmx ! de>
Date: 2007-09-30 22:44:31
Message-ID: 1191192271.897783.14526.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 719333 by apaku:
Port to latest changes in kdevplatform
M +20 -20 quantaprojectfilemanager.cpp
M +6 -7 quantaprojectfilemanager.h
--- trunk/KDE/kdewebdev/quanta/plugins/project/projectfilemanager/quantaprojectfilemanager.cpp \
#719332:719333 @@ -7,8 +7,8 @@
* \
*
* See COPYING file that comes with this distribution for details. \
*
***************************************************************************/
-
-#include "quantaprojectfilemanager.h"
+
+#include "quantaprojectfilemanager.h"
#include "extfileinfo.h"
#include <icore.h>
@@ -45,7 +45,7 @@
{
}
-KDevelop::ProjectItem* QuantaProjectFileManager::import(KDevelop::IProject \
*project) +KDevelop::ProjectFolderItem* \
QuantaProjectFileManager::import(KDevelop::IProject *project) {
KUrl url = project->folder();
QString name = project->name();
@@ -73,15 +73,15 @@
baseUrl.setPath(dir.canonicalPath());
baseUrl.adjustPath(KUrl::RemoveTrailingSlash);
}
- dom.setContent(&f);
- f.close();
-
+ dom.setContent(&f);
+ f.close();
+
url = baseUrl;
- url.adjustPath(KUrl::AddTrailingSlash);
+ url.adjustPath(KUrl::AddTrailingSlash);
m_projectFolders[url] = QStringList();
QStack<KUrl> urlStack;
KUrl parent;
- //read the items from the dom
+ //read the items from the dom
QString tmpString;
QDomNodeList nl = dom.firstChild().firstChild().childNodes();
QDomElement el;
@@ -120,8 +120,8 @@
el.parentNode().removeChild( el );
i--;
skipItem = true;
- }
- }
+ }
+ }
if (!skipItem)
{
KUrl fileUrl = url;
@@ -155,17 +155,17 @@
}
}
}
- }
+ }
} else
KMessageBox::error(mainWindow, i18n("<qt>Cannot open the downloaded \
project file.</qt>"));
- } else
+ } else
{
KMessageBox::error(mainWindow, i18n("<qt>Cannot access the project \
file <b>%1</b>.</qt>").arg(url.pathOrUrl())); }
-
+
//create the base item
- KDevelop::ProjectItem *baseItem = new KDevelop::ProjectItem(project, \
project->folder().pathOrUrl(), 0L);
-
+ KDevelop::ProjectFolderItem *baseItem = new \
KDevelop::ProjectFolderItem(project, project->folder().pathOrUrl(), 0L); + \
baseItem->setProjectRoot( true ); return baseItem;
}
@@ -176,21 +176,21 @@
url.adjustPath(KUrl::AddTrailingSlash);
KDevelop::IProject *project = base->project();
// kDebug(24000) << "Request parse for : " << url;
-
+
KUrl::List::ConstIterator itBegin = m_projectFolders[url].constBegin();
KUrl::List::ConstIterator itEnd = m_projectFolders[url].constEnd();
for (KUrl::List::ConstIterator it = itBegin; it != itEnd; ++it)
{
subFolders.append(new KDevelop::ProjectFolderItem(project, *it, \
base)); }
-
+
itBegin = m_projectFiles[url].constBegin();
itEnd = m_projectFiles[url].constEnd();
for (KUrl::List::ConstIterator it = itBegin; it != itEnd; ++it)
{
new KDevelop::ProjectFileItem(project, *it, base);
}
-
+
return subFolders;
}
@@ -210,7 +210,7 @@
//TODO implement it
return false;
}
-
+
bool QuantaProjectFileManager::removeFile(KDevelop::ProjectFileItem *file)
{
//TODO implement it
@@ -222,7 +222,7 @@
//TODO implement it
return false;
}
-
+
bool QuantaProjectFileManager::renameFolder(KDevelop::ProjectFolderItem \
*oldFolder, const KUrl &newFolder) {
//TODO implement it
--- trunk/KDE/kdewebdev/quanta/plugins/project/projectfilemanager/quantaprojectfilemanager.h \
#719332:719333 @@ -7,7 +7,7 @@
* \
*
* See COPYING file that comes with this distribution for details. \
*
**************************************************************************/
-
+
#ifndef QUANTAPROJECTFILEMANAGER_H
#define QUANTAPROJECTFILEMANAGER_H
@@ -19,14 +19,13 @@
class ProjectBaseItem;
class ProjectFolderItem;
class ProjectFileItem;
- class ProjectItem;
}
class KDialogBase;
/**
* @short This class operates on the Quanta specific project file.
- *
+ *
* @author Andras Mantia <amantia@kde.org>
*/
class QuantaProjectFileManager : public KDevelop::IPlugin, public \
KDevelop::IProjectFileManager @@ -38,7 +37,7 @@
const QVariantList &args = QVariantList());
virtual ~QuantaProjectFileManager();
-
+
//Reimplemented methods from IProjectFileManager
virtual Features features() const { return Features(Folders | Files); }
@@ -48,14 +47,14 @@
* @param project the project
* @return the root item
*/
- virtual KDevelop::ProjectItem* import(KDevelop::IProject *project);
+ virtual KDevelop::ProjectFolderItem* import(KDevelop::IProject \
*project); virtual KDevelop::ProjectFolderItem* addFolder(const KUrl \
&folder, KDevelop::ProjectFolderItem *parent); virtual \
KDevelop::ProjectFileItem* addFile(const KUrl &folder, \
KDevelop::ProjectFolderItem *parent); virtual bool \
removeFolder(KDevelop::ProjectFolderItem *folder); virtual bool \
removeFile(KDevelop::ProjectFileItem *file); virtual bool \
renameFile(KDevelop::ProjectFileItem *oldFile, const KUrl &newFile); \
virtual bool renameFolder(KDevelop::ProjectFolderItem *oldFolder, const \
KUrl &newFolder);
-
+
Q_SIGNALS:
//Declare again the signals as IProjectFileManager doesn't inherit from \
QObject void projectItemConfigWidget(const \
QList<KDevelop::ProjectBaseItem*> &dom, KDialogBase *dialog); @@ -65,7 \
+64,7 @@ void fileAdded(KDevelop::ProjectFileItem* file);
void fileRemoved(KDevelop::ProjectFileItem* file);
void fileRenamed(const KUrl& oldFile, KDevelop::ProjectFileItem* \
newFile);
-
+
private:
QMap<KUrl, KUrl::List> m_projectFolders; ///< list of project folders, \
and the subfolders for each folder in the form of <folder,subfolder> \
QMap<KUrl, KUrl::List> m_projectFiles; ///< list of project folders, and \
the files for each folder in the form of <folder,files>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic