diff --git a/language/assistant/renameassistant.h b/language/assistant/renameassistant.h index f3fdf0580..14752dbfb 100644 --- a/language/assistant/renameassistant.h +++ b/language/assistant/renameassistant.h @@ -1,57 +1,57 @@ /* Copyright 2010 Olivier de Gaalon Copyright 2014 Kevin Funk This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef KDEVPLATFORM_RENAMEEASSISTANT_H -#define KDEVPLATFORM_RENAMEEASSISTANT_H +#ifndef KDEVPLATFORM_RENAMEASSISTANT_H +#define KDEVPLATFORM_RENAMEASSISTANT_H #include #include #include #include #include "renameaction.h" namespace KTextEditor { class View; } namespace KDevelop { class KDEVPLATFORMLANGUAGE_EXPORT RenameAssistant : public StaticAssistant { Q_OBJECT public: explicit RenameAssistant(ILanguageSupport* supportedLanguage); ~RenameAssistant() override; void textChanged(KTextEditor::Document* doc, const KTextEditor::Range& invocationRange, const QString& removedText = QString()) override; bool isUseful() const override; KTextEditor::Range displayRange() const override; QString title() const override; private: struct Private; QScopedPointer const d; }; } -#endif // KDEVPLATFORM_RENAMEEASSISTANT_H +#endif // KDEVPLATFORM_RENAMEASSISTANT_H diff --git a/language/codegen/progressdialogs/refactoringdialog.h b/language/codegen/progressdialogs/refactoringdialog.h index 52c338000..5ee484b4e 100644 --- a/language/codegen/progressdialogs/refactoringdialog.h +++ b/language/codegen/progressdialogs/refactoringdialog.h @@ -1,50 +1,50 @@ /*************************************************************************** * This file is part of KDevelop * * Copyright 2008 David Nolden * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef PROGRESSDIALOGS_H -#define PROGRESSDIALOGS_H +#ifndef KDEVPLATFORM_REFACTORINGDIALOG_H +#define KDEVPLATFORM_REFACTORINGDIALOG_H #include #include #include "ui_refactoringdialog.h" namespace KDevelop { class UsesCollector; class RefactoringProgressDialog : public QDialog { Q_OBJECT public: RefactoringProgressDialog(const QString& action, UsesCollector* collector); private slots: void progress(uint done, uint max); void maximumProgress(uint max); void processUses(const KDevelop::ReferencedTopDUContext& context); private: UsesCollector* m_collector; Ui::RefactoringDialog m_rd; }; } #endif diff --git a/language/duchain/duchaindumper.h b/language/duchain/duchaindumper.h index 24398aeba..a777c5ce1 100644 --- a/language/duchain/duchaindumper.h +++ b/language/duchain/duchaindumper.h @@ -1,72 +1,72 @@ /* This file is part of KDevelop Copyright 2002-2005 Roberto Raggi Copyright 2006 Hamish Rodda Copyright 2007 David Nolden Copyright 2010 Milian Wolff Copyright 2014 Kevin Funk This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef KDEVPLATFORM_DUMPCHAIN_H -#define KDEVPLATFORM_DUMPCHAIN_H +#ifndef KDEVPLATFORM_DUCHAINDUMPER_H +#define KDEVPLATFORM_DUCHAINDUMPER_H #include #include #include class QTextStream; namespace KDevelop { class DUContext; /** * @brief Debugging utility function to dump a DUContext including contained declarations. */ class KDEVPLATFORMLANGUAGE_EXPORT DUChainDumper { public: enum Feature { NoFeatures = 0, DumpContext = 1 << 0, DumpProblems = 1 << 1 }; Q_DECLARE_FLAGS(Features, Feature); explicit DUChainDumper(Features features = DumpContext); ~DUChainDumper(); /** * Dump DUChain context to stdout * * NOTE: The DUChain must be readlocked when this is called. * * @param context The context to dump * @param allowedDepth How deep the dump will go into imported contexts, printing all the contents. */ void dump(DUContext* context, int allowedDepth = 0); void dump(DUContext* context, int allowedDepth, QTextStream& out); private: struct Private; QScopedPointer d; }; } -#endif // KDEVPLATFORM_DUMPCHAIN_H +#endif // KDEVPLATFORM_DUCHAINDUMPER_H diff --git a/plugins/documentview/kdevdocumentviewplugin.h b/plugins/documentview/kdevdocumentviewplugin.h index f51336732..1a1f74a58 100644 --- a/plugins/documentview/kdevdocumentviewplugin.h +++ b/plugins/documentview/kdevdocumentviewplugin.h @@ -1,49 +1,49 @@ /* This file is part of KDevelop Copyright 2005 Adam Treat This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef KDEVPLATFORM_PLUGIN_KDEVDOCUMENTVIEW_PART_H -#define KDEVPLATFORM_PLUGIN_KDEVDOCUMENTVIEW_PART_H +#ifndef KDEVPLATFORM_PLUGIN_KDEVDOCUMENTVIEWPLUGIN_H +#define KDEVPLATFORM_PLUGIN_KDEVDOCUMENTVIEWPLUGIN_H #include #include class KDevDocumentViewPluginFactory; class KDevDocumentViewPlugin: public KDevelop::IPlugin { Q_OBJECT public: enum RefreshPolicy { Refresh, NoRefresh, ForceRefresh }; public: KDevDocumentViewPlugin( QObject *parent, const QVariantList& args ); ~KDevDocumentViewPlugin() override; void unload() override; private: KDevDocumentViewPluginFactory* factory; }; #endif diff --git a/plugins/grepview/grepviewplugin.h b/plugins/grepview/grepviewplugin.h index 93bb24f3a..ca54edf16 100644 --- a/plugins/grepview/grepviewplugin.h +++ b/plugins/grepview/grepviewplugin.h @@ -1,72 +1,72 @@ /*************************************************************************** * Copyright 1999-2001 by Bernd Gehrmann * * bernd@kdevelop.org * * Copyright 2010 Julien Desgats * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ -#ifndef GREPVIEWPART_H_ -#define GREPVIEWPART_H_ +#ifndef KDEVPLATFORM_PLUGIN_GREPVIEWPLUGIN_H +#define KDEVPLATFORM_PLUGIN_GREPVIEWPLUGIN_H #include #include #include #include class KJob; class GrepDialog; class GrepJob; class GrepOutputViewFactory; class GrepViewPlugin : public KDevelop::IPlugin { Q_OBJECT Q_CLASSINFO( "D-Bus Interface", "org.kdevelop.GrepViewPlugin" ) public: explicit GrepViewPlugin( QObject *parent, const QVariantList & = QVariantList() ); ~GrepViewPlugin() override; void unload() override; void rememberSearchDirectory(QString const & directory); KDevelop::ContextMenuExtension contextMenuExtension(KDevelop::Context* context) override; void showDialog(bool setLastUsed = false, QString pattern = QString(), bool show = true); /** * Returns a new instance of GrepJob. Since the plugin supports only one job at the same time, * previous job, if any, is killed before creating a new job. */ GrepJob *newGrepJob(); GrepJob *grepJob(); GrepOutputViewFactory* toolViewFactory() const; public Q_SLOTS: ///@param pattern the pattern to search ///@param directory the directory, or a semicolon-separated list of files ///@param show whether the search dialog should be shown. if false, /// the parameters of the last search will be used. Q_SCRIPTABLE void startSearch(QString pattern, QString directory, bool show); Q_SIGNALS: Q_SIGNAL void grepJobFinished(); private Q_SLOTS: void showDialogFromMenu(); void showDialogFromProject(); void jobFinished(KJob *job); private: GrepJob *m_currentJob; QPointer m_currentDialog; QString m_directory; QString m_contextMenuDirectory; GrepOutputViewFactory* m_factory; }; #endif diff --git a/plugins/problemreporter/problemhighlighter.h b/plugins/problemreporter/problemhighlighter.h index 97dde7a2e..70d1256f0 100644 --- a/plugins/problemreporter/problemhighlighter.h +++ b/plugins/problemreporter/problemhighlighter.h @@ -1,53 +1,53 @@ /* * KDevelop Problem Reporter * * Copyright 2008 Hamish Rodda * Copyright 2008-2009 David Nolden * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef KDEVPLATFORM_PLUGIN_PROBLEM_HIGHLIGHT_H -#define KDEVPLATFORM_PLUGIN_PROBLEM_HIGHLIGHT_H +#ifndef KDEVPLATFORM_PLUGIN_PROBLEMHIGHLIGHTER_H +#define KDEVPLATFORM_PLUGIN_PROBLEMHIGHLIGHTER_H #include #include #include #include class ProblemHighlighter : public QObject { Q_OBJECT public: explicit ProblemHighlighter(KTextEditor::Document* document); ~ProblemHighlighter() override; void setProblems(const QVector& problems); private slots: void aboutToRemoveText(const KTextEditor::Range& range); void clearProblems(); private: QPointer m_document; QList m_topHLRanges; QVector m_problems; public slots: void settingsChanged(); }; -#endif // KDEVPLATFORM_PLUGIN_PROBLEM_HIGHLIGHT_H +#endif // KDEVPLATFORM_PLUGIN_PROBLEMHIGHLIGHTER_H diff --git a/plugins/problemreporter/problemtreeview.h b/plugins/problemreporter/problemtreeview.h index 331c16b42..913725bd0 100644 --- a/plugins/problemreporter/problemtreeview.h +++ b/plugins/problemreporter/problemtreeview.h @@ -1,76 +1,76 @@ /* * KDevelop Problem Reporter * * Copyright (c) 2007 Hamish Rodda * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef KDEVPLATFORM_PLUGIN_PROBLEMWIDGET_H -#define KDEVPLATFORM_PLUGIN_PROBLEMWIDGET_H +#ifndef KDEVPLATFORM_PLUGIN_PROBLEMTREEVIEW_H +#define KDEVPLATFORM_PLUGIN_PROBLEMTREEVIEW_H #include namespace KDevelop { class TopDUContext; class IDocument; class ProblemModel; } class ProblemReporterPlugin; class QSortFilterProxyModel; class ProblemTreeView : public QTreeView { Q_OBJECT public: ProblemTreeView(QWidget* parent, QAbstractItemModel* itemModel); ~ProblemTreeView() override; KDevelop::ProblemModel* model() const; void setModel(QAbstractItemModel* model) override; void contextMenuEvent(QContextMenuEvent*) override; void dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector& roles = QVector()) override; void reset() override; int setFilter(const QString& filterText); public slots: void openDocumentForCurrentProblem(); signals: // Emitted when the model's rows change (added/removed/reset) void changed(); protected: void showEvent(QShowEvent* event) override; private slots: void itemActivated(const QModelIndex& index); private: void resizeColumns(); ProblemReporterPlugin* m_plugin; QSortFilterProxyModel* m_proxy; }; #endif // kate: space-indent on; indent-width 2; tab-width: 4; replace-tabs on; auto-insert-doxygen on diff --git a/plugins/quickopen/actionsquickopenprovider.h b/plugins/quickopen/actionsquickopenprovider.h index 022090b2e..fd3f3ded3 100644 --- a/plugins/quickopen/actionsquickopenprovider.h +++ b/plugins/quickopen/actionsquickopenprovider.h @@ -1,44 +1,44 @@ /* * This file is part of KDevelop * * Copyright 2015 Aleix Pol Gonzalez * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef KDEVPLATFORM_PLUGIN_ACTIONSPROVIDER_H -#define KDEVPLATFORM_PLUGIN_ACTIONSPROVIDER_H +#ifndef KDEVPLATFORM_PLUGIN_ACTIONSQUICKOPENPROVIDER_H +#define KDEVPLATFORM_PLUGIN_ACTIONSQUICKOPENPROVIDER_H #include #include class ActionsQuickOpenProvider : public KDevelop::QuickOpenDataProviderBase { Q_OBJECT public: ActionsQuickOpenProvider(); KDevelop::QuickOpenDataPointer data(uint row) const override; uint unfilteredItemCount() const override; uint itemCount() const override; void reset() override; void setFilterText(const QString& text) override; private: QVector m_results; }; -#endif // KDEVPLATFORM_PLUGIN_ACTIONSPROVIDER_H +#endif // KDEVPLATFORM_PLUGIN_ACTIONSQUICKOPENPROVIDER_H diff --git a/plugins/switchtobuddy/switchtobuddyplugin.h b/plugins/switchtobuddy/switchtobuddyplugin.h index e1428ec8d..42200adfc 100644 --- a/plugins/switchtobuddy/switchtobuddyplugin.h +++ b/plugins/switchtobuddy/switchtobuddyplugin.h @@ -1,86 +1,86 @@ /* * This file is part of KDevelop * Copyright 2012 André Stein * Copyright 2014 Kevin Funk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef KDEVPLATFORM_PLUGIN_SWITCHTOBUDDY_H -#define KDEVPLATFORM_PLUGIN_SWITCHTOBUDDY_H +#ifndef KDEVPLATFORM_PLUGIN_SWITCHTOBUDDYPLUGIN_H +#define KDEVPLATFORM_PLUGIN_SWITCHTOBUDDYPLUGIN_H #include #include #include #include Q_DECLARE_LOGGING_CATEGORY(PLUGIN_SWITCHTOBUDDY) /** * @short Implements a context menu extension in an editor context which provides * an action that allows switching to associated buddy documents. * * Using the @c IBuddyDocumentFinder interface, the current document's * language plugin provides potential buddy candidates. Depending on their * existence on the file system the @c SwitchToBuddyPlugin * enables a 'Switch To XXX' action which opens that buddy document * using the @c IDocumentController. * * If a language plugin either doens't provide the @c IBuddyDocumentFinder * interface or no buddy exists on the file system, no context menu * extension is performed. * * @see IBuddyDocumentFinder * @see IDocumentController */ class SwitchToBuddyPlugin : public KDevelop::IPlugin { Q_OBJECT public: explicit SwitchToBuddyPlugin( QObject *parent, const QVariantList & = QVariantList()); ~SwitchToBuddyPlugin() override; KDevelop::ContextMenuExtension contextMenuExtension(KDevelop::Context* context) override; void createActionsForMainWindow(Sublime::MainWindow* window, QString& xmlFile, KActionCollection& actions) override; private slots: /** * Context menu slot which switches to the QUrl provided * in the data part of the sending QAction. */ void switchToBuddy(const QString& url); /** * Switch between header and source files */ void switchHeaderSource(); /** * @brief Switch between definitions and declarations * * E.g. if the cursor in the currently active view points to an implementation file * this shortcut will open the header document (or any buddy file). * * Furthermore, if the cursor points to a definition, and the buddy document contains its declaration, * the cursor will be also set to the declaration's position when the buddy document is opened */ void switchDefinitionDeclaration(); private: class QSignalMapper* m_signalMapper; }; -#endif // KDEVPLATFORM_PLUGIN_SWITCHTOBUDDY_H +#endif // KDEVPLATFORM_PLUGIN_SWITCHTOBUDDYPLUGIN_H diff --git a/plugins/welcomepage/welcomepageplugin.h b/plugins/welcomepage/welcomepageplugin.h index dd27d9454..8cdcc79d0 100644 --- a/plugins/welcomepage/welcomepageplugin.h +++ b/plugins/welcomepage/welcomepageplugin.h @@ -1,32 +1,32 @@ /* This file is part of KDevelop * Copyright 2010 Aleix Pol Gonzalez * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#ifndef KDEVPLATFORM_PLUGIN_KDEVPROJECTDASHBOARD_H -#define KDEVPLATFORM_PLUGIN_KDEVPROJECTDASHBOARD_H +#ifndef KDEVPLATFORM_PLUGIN_KDEVWELCOMEPAGEPLUGIN_H +#define KDEVPLATFORM_PLUGIN_KDEVWELCOMEPAGEPLUGIN_H #include class KDevWelcomePagePlugin : public KDevelop::IPlugin { Q_OBJECT public: KDevWelcomePagePlugin( QObject* parent, const QList& ); }; #endif diff --git a/project/abstractfilemanagerplugin.h b/project/abstractfilemanagerplugin.h index 7bfabaf95..dcc83ef46 100644 --- a/project/abstractfilemanagerplugin.h +++ b/project/abstractfilemanagerplugin.h @@ -1,149 +1,149 @@ /*************************************************************************** * This file is part of KDevelop * * Copyright 2010-2012 Milian Wolff * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef KDEVPLATFORM_ABSTRACTGENERICMANAGER_H -#define KDEVPLATFORM_ABSTRACTGENERICMANAGER_H +#ifndef KDEVPLATFORM_ABSTRACTFILEMANAGERPLUGIN_H +#define KDEVPLATFORM_ABSTRACTFILEMANAGERPLUGIN_H #include "projectexport.h" #include "interfaces/iprojectfilemanager.h" #include #include class KDirWatch; namespace KDevelop { class FileManagerListJob; /** * This class can be used as a common base for file managers. * * It supports remote files using KIO and uses KDirWatch to synchronize with on-disk changes. */ class KDEVPLATFORMPROJECT_EXPORT AbstractFileManagerPlugin : public IPlugin, public virtual IProjectFileManager { Q_OBJECT Q_INTERFACES( KDevelop::IProjectFileManager ) public: explicit AbstractFileManagerPlugin( const QString& componentName, QObject *parent = nullptr, const QVariantList &args = QVariantList() ); ~AbstractFileManagerPlugin() override; // // IProjectFileManager interface // Features features() const override; ProjectFolderItem* addFolder( const Path& folder, ProjectFolderItem *parent ) override; ProjectFileItem* addFile( const Path& file, ProjectFolderItem *parent ) override; bool removeFilesAndFolders( const QList &items ) override; bool moveFilesAndFolders(const QList< ProjectBaseItem* >& items, ProjectFolderItem* newParent) override; bool copyFilesAndFolders(const Path::List& items, ProjectFolderItem* newParent) override; bool renameFolder(ProjectFolderItem* folder, const Path& newPath) override; bool renameFile(ProjectFileItem* file, const Path& newPath) override; QList parse( ProjectFolderItem *item ) override; ProjectFolderItem *import( IProject *project ) override; bool reload(ProjectFolderItem* item) override; KJob* createImportJob(ProjectFolderItem* item) override; protected: // // AbstractFileManagerPlugin interface // /** * Filter interface making it possible to hide files and folders from a project. * * The default implementation will query all IProjectFilter plugins and ask them * whether a given url should be included or not. * * @return True when @p path should belong to @p project, false otherwise. */ virtual bool isValid(const Path& path, const bool isFolder, IProject* project) const; /** * Customization hook enabling you to create custom FolderItems if required. * * The default implementation will return a simple @c ProjectFolderItem */ virtual ProjectFolderItem* createFolderItem( IProject* project, const Path& path, ProjectBaseItem* parent = nullptr); /** * Customization hook enabling you to create custom FileItems if required. * * The default implementation will return a simple @c ProjectFileItem */ virtual ProjectFileItem* createFileItem( IProject* project, const Path& path, ProjectBaseItem* parent); /** * @return the @c KDirWatch for the given @p project. */ KDirWatch* projectWatcher( IProject* project ) const; /** * Sets a list of filenames to ignore when importing a project * the filter is applied to files and folders, so both will be ignored. * * The filenames are matched via QString::operator==(), so no wildcard or * regex-matching for now * * This can be used for things like VCS-folders/files or other things a * plugin might want to hide. */ void setImportFileNameFilter( const QStringList& filterNames ); private: struct Private; // friend class Private; Private* const d; Q_PRIVATE_SLOT(d, KJob* eventuallyReadFolder( ProjectFolderItem* item )) Q_PRIVATE_SLOT(d, void addJobItems(FileManagerListJob* job, ProjectFolderItem* baseItem, const KIO::UDSEntryList& entries)) Q_PRIVATE_SLOT(d, void deleted(const QString &path)) Q_PRIVATE_SLOT(d, void created(const QString &path)) Q_PRIVATE_SLOT(d, void projectClosing(KDevelop::IProject* project)) Q_PRIVATE_SLOT(d, void jobFinished(KJob* job)) Q_SIGNALS: void reloadedFileItem(KDevelop::ProjectFileItem* file); void reloadedFolderItem(KDevelop::ProjectFolderItem* folder); void folderAdded(KDevelop::ProjectFolderItem* folder); void folderRemoved(KDevelop::ProjectFolderItem* folder); void folderRenamed(const KDevelop::Path& oldFolder, KDevelop::ProjectFolderItem* newFolder); void fileAdded(KDevelop::ProjectFileItem* file); void fileRemoved(KDevelop::ProjectFileItem* file); void fileRenamed(const KDevelop::Path& oldFile, KDevelop::ProjectFileItem* newFile); }; } -#endif // KDEVPLATFORM_ABSTRACTGENERICMANAGER_H +#endif // KDEVPLATFORM_ABSTRACTFILEMANAGERPLUGIN_H diff --git a/shell/problemstorenode.h b/shell/problemstorenode.h index 19aba61c6..9fe058c46 100644 --- a/shell/problemstorenode.h +++ b/shell/problemstorenode.h @@ -1,222 +1,222 @@ /* * Copyright 2015 Laszlo Kis-Adam * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef PROBLEMNODE_H -#define PROBLEMNODE_H +#ifndef KDEVPLATFORM_PROBLEMSTORENODE_H +#define KDEVPLATFORM_PROBLEMSTORENODE_H #include #include #include namespace KDevelop { /** * @brief Base class for ProblemStoreNode classes, which together make up a tree structure with label or problem leaves. * * When adding a child the node is automatically reparented. * * Usage: * @code * ProblemStoreNode *root = new ProblemStoreNode(); * root->addChild(new ProblemStoreNode()); * root->addChild(new ProblemStoreNode()); * root->addChild(new ProblemStoreNode()); * root->count(); // Returns 3 * @endcode * */ class ProblemStoreNode { public: explicit ProblemStoreNode(ProblemStoreNode *parent = nullptr) { m_parent = parent; } virtual ~ProblemStoreNode() { clear(); } /// Clear the children nodes void clear() { qDeleteAll(m_children); m_children.clear(); } /// Tells if the node is a root node. /// A node is considered a root node (in this context), when it has no parent bool isRoot() const { if(!m_parent) return true; else return false; } /// Returns the index of this node in the parent's child list. int index() { if(!m_parent) return -1; const QVector &children = m_parent->children(); return children.indexOf(this); } /// Returns the parent of this node ProblemStoreNode* parent() const{ return m_parent; } /// Sets the parent of this node void setParent(ProblemStoreNode *parent) { m_parent = parent; } /// Returns the number of children nodes int count() const { return m_children.count(); } /// Returns a particular child node ProblemStoreNode* child(int row) const { return m_children[row]; } /// Returns the list of children nodes const QVector& children() const{ return m_children; } /// Adds a child node, and reparents the child void addChild(ProblemStoreNode *child) { m_children.push_back(child); child->setParent(this); } /// Returns the label of this node, if there's one virtual QString label() const{ return QString(); } /// Returns the node's stored problem, if there's such virtual IProblem::Ptr problem() const{ return IProblem::Ptr(nullptr); } private: /// The parent node ProblemStoreNode *m_parent; /// Children nodes QVector m_children; }; /////////////////////////////////////////////////////////////////////////////////////////////////////// /** * @brief A ProblemStoreNode that contains a label. For example: Label for severity or path grouping of problem nodes. * * Usage: * @code * ProblemStoreNode *root = new ProblemStoreNode(); * ... * root->addChild(new LabelNode(root, QStringLiteral("ERROR"))); * root->children().last()->label(); // "ERROR" * @endcode * */ class LabelNode : public ProblemStoreNode { public: explicit LabelNode(ProblemStoreNode *parent = nullptr, const QString &l = QString()) : ProblemStoreNode(parent) , m_label(l) { } ~LabelNode() { } QString label() const{ return m_label; } /// Sets the label void setLabel(const QString &s){ m_label = s; } private: /// The label QString m_label; }; //////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * @brief A ProblemStoreNode that contains a problem. For example: as part of a problem list in a severity or path group. * * Usage: * @code * IProblem::Ptr problem1(new DetectedProblem()); * ... * label->addChild(new ProblemNode(label, problem1)); * label->children().last()->problem(); // Provides problem1 * @endcode * */ class ProblemNode : public ProblemStoreNode { public: explicit ProblemNode(ProblemStoreNode *parent = nullptr, const IProblem::Ptr &problem = IProblem::Ptr(nullptr)) : ProblemStoreNode(parent) , m_problem(problem) { } ~ProblemNode() { } IProblem::Ptr problem() const{ return m_problem; } /// Sets the problem void setProblem(const IProblem::Ptr &problem){ m_problem = problem; } private: /// The problem IProblem::Ptr m_problem; }; } #endif diff --git a/sublime/idealcontroller.h b/sublime/idealcontroller.h index 92ebd9d0a..b6530fdd5 100644 --- a/sublime/idealcontroller.h +++ b/sublime/idealcontroller.h @@ -1,133 +1,133 @@ /* Copyright 2007 Roberto Raggi Copyright 2007 Hamish Rodda Copyright 2011 Alexander Dymo Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE KDEVELOP TEAM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef SUBLIME_IDEAL_H -#define SUBLIME_IDEAL_H +#ifndef SUBLIME_IDEALCONTROLLER_H +#define SUBLIME_IDEALCONTROLLER_H #include #include #include #include #include #include #include "sublimedefs.h" class QAction; class KActionMenu; namespace Sublime { class Area; class View; class MainWindow; class IdealButtonBarWidget; class IdealDockWidget; class View; class IdealController: public QObject { Q_OBJECT public: explicit IdealController(Sublime::MainWindow *mainWindow); void addView(Qt::DockWidgetArea area, View* view); enum RaiseMode { HideOtherViews, GroupWithOtherViews }; void raiseView(View* view, RaiseMode mode = HideOtherViews); void showDockWidget(IdealDockWidget* dock, bool show); void focusEditor(); QWidget *statusBarLocation() const; QAction* actionForView(View* view) const; void setShowDockStatus(Qt::DockWidgetArea area, bool checked); /** Remove view. If nondestructive true, view->widget() is not deleted, as is left with NULL parent. Otherwise, it's deleted. */ void removeView(View* view, bool nondestructive = false); void moveView(View *view, Qt::DockWidgetArea area); void showLeftDock(bool show); void showRightDock(bool show); void showBottomDock(bool show); void toggleDocksShown(); IdealButtonBarWidget* barForDockArea(Qt::DockWidgetArea area) const; QAction* actionForArea(Qt::DockWidgetArea area) const; enum Direction { NextDock, PrevDock }; void goPrevNextDock(IdealController::Direction direction); IdealButtonBarWidget *leftBarWidget; IdealButtonBarWidget *rightBarWidget; IdealButtonBarWidget *bottomBarWidget; IdealButtonBarWidget *topBarWidget; QWidget *bottomStatusBarLocation; IdealDockWidget* currentDockWidget(); QMap > lastDockWidget; void emitWidgetResized(Qt::DockWidgetArea dockArea, int thickness); QList allDockWidgets(); Q_SIGNALS: /// Emitted, when a context menu is requested on one of the dock bars. /// When no actions gets associated to the QMenu, it won't be shown. void dockBarContextMenuRequested(Qt::DockWidgetArea area, const QPoint& position); void dockShown(Sublime::View*, Sublime::Position pos, bool shown); void widgetResized(Qt::DockWidgetArea dockArea, int thickness); private Q_SLOTS: void slotDockBarContextMenuRequested(QPoint position); void dockLocationChanged(Qt::DockWidgetArea); void loadSettings(); private: void hideDocks(IdealButtonBarWidget *bar); void showDock(Qt::DockWidgetArea area, bool show); void toggleDocksShown(IdealButtonBarWidget *bar, bool show); Sublime::MainWindow *m_mainWindow; QSet docks; /** Map from View to an action that shows/hides the IdealDockWidget containing that view. */ QMap m_view_to_action; /** Map from IdealDockWidget to an action that shows/hides that IdealDockWidget. */ QMap m_dockwidget_to_action; KActionMenu* m_docks; QAction* m_showLeftDock; QAction* m_showRightDock; QAction* m_showBottomDock; QAction* m_showTopDock; }; } #endif