This file is indexed.

/usr/include/kdevplatform/shell/projectcontroller.h is in kdevelop-dev 4:5.2.1-1ubuntu4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/* This file is part of KDevelop
Copyright 2006 Adam Treat <treat@kde.org>
Copyright 2007 Andreas Pakulat <apaku@gmx.de>

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_PROJECTCONTROLLER_H
#define KDEVPLATFORM_PROJECTCONTROLLER_H

#include <interfaces/iprojectcontroller.h>

#include <QUrl>

#include <KIO/UDSEntry>

#include "shellexport.h"

namespace Sublime {
    class Area;
}

namespace KIO {
    class Job;
}

namespace KDevelop
{

class IProject;
class Core;
class Context;
class ContextMenuExtension;
class IPlugin;

class KDEVPLATFORMSHELL_EXPORT IProjectDialogProvider : public QObject
{
Q_OBJECT
public:
    IProjectDialogProvider();
    ~IProjectDialogProvider() override;

public Q_SLOTS:
    /**
     * Displays some UI to ask the user for the project location.
     *
     * @param fetch will tell the UI that the user might want to fetch the project first
     * @param startUrl tells where to look first
     */
    virtual QUrl askProjectConfigLocation(bool fetch, const QUrl& startUrl = QUrl(),
                                          const QUrl& repoUrl = QUrl(), IPlugin* plugin = nullptr) = 0;
    virtual bool userWantsReopen() = 0;
};

class KDEVPLATFORMSHELL_EXPORT ProjectController : public IProjectController
{
    Q_OBJECT
    Q_CLASSINFO( "D-Bus Interface", "org.kdevelop.ProjectController" )
    friend class Core;
    friend class CorePrivate;
    friend class ProjectPreferences;

public:
    explicit ProjectController( Core* core );
    ~ProjectController() override;

    IProject* projectAt( int ) const override;
    int projectCount() const override;
    QList<IProject*> projects() const override;

    ProjectBuildSetModel* buildSetModel() override;
    ProjectModel* projectModel() override;
    ProjectChangesModel* changesModel() override;
    IProject* findProjectByName( const QString& name ) override;
    IProject* findProjectForUrl( const QUrl& ) const override;

    bool isProjectNameUsed( const QString& name ) const override;
    void setDialogProvider(IProjectDialogProvider*);

    QUrl projectsBaseDirectory() const override;
    QString prettyFileName(const QUrl& url, FormattingOptions format = FormatHtml) const override;
    QString prettyFilePath(const QUrl& url, FormattingOptions format = FormatHtml) const override;

    ContextMenuExtension contextMenuExtension(KDevelop::Context* ctx, QWidget* parent);

    void fetchProjectFromUrl(const QUrl& repoUrl, IPlugin* vcsOrProviderPlugin);

public Q_SLOTS:
    Q_SCRIPTABLE void openProjectForUrl( const QString &sourceUrl ) { openProjectForUrl(QUrl(sourceUrl)); }
    void openProjectForUrl( const QUrl &sourceUrl ) override;
    void fetchProject();
    void openProject( const QUrl &KDev4ProjectFile = QUrl() ) override;
    void abortOpeningProject( IProject* );
    void projectImportingFinished( IProject* );
    void closeProject( IProject* ) override;
    void closeAllProjects() override;
    void configureProject( IProject* ) override;

    void reparseProject( IProject* project, bool forceUpdate = false  ) override;

    void eventuallyOpenProjectFile(KIO::Job*,KIO::UDSEntryList);
    void openProjectForUrlSlot(bool);
//     void changeCurrentProject( ProjectBaseItem* );
    void openProjects(const QList<QUrl>& projects);
    void commitCurrentProject();

    // Maps the given path from the source to the equivalent path within the build directory
    // of the corresponding project. If the path is already in the build directory and fallbackRoot is true,
    // then it is mapped to the root of the build directory.
    // This is used through DBus from within kdevplatform_shell_environment.sh
    // If reverse is true, maps the opposite direction, from build to source. [ Used in kdevplatform_shell_environment.sh ]
    Q_SCRIPTABLE QString mapSourceBuild( const QString& path, bool reverse = false, bool fallbackRoot = true ) const;

protected:
    /**
     * Add the existing project @p project to the controller
     *
     * @note Method is used for testing objectives, consider using openProject() instead!
     * @note takes ownership over the project
     *
     * @sa openProject()
     */
    void addProject(IProject* proj);
    /**
     * Remove the project @p project from the controller
     *
     * @note Ownership is passed on to the caller
     */
    void takeProject(IProject* proj);

    virtual void loadSettings( bool projectIsLoaded );
    virtual void saveSettings( bool projectIsLoaded );

    virtual void initialize();

private:
    //FIXME Do not load all of this just for the project being opened...
    //void legacyLoading();
    void setupActions();
    void cleanup();

    // helper methods for closeProject()
    void unloadUnusedProjectPlugins(IProject* proj);
    void disableProjectCloseAction();
    void closeAllOpenedFiles(IProject* proj);
    void initializePluginCleanup(IProject* proj);

private:
    const QScopedPointer<class ProjectControllerPrivate> d;
    friend class ProjectControllerPrivate;
};

class ProjectDialogProvider : public IProjectDialogProvider
{
Q_OBJECT
public:
    explicit ProjectDialogProvider(ProjectControllerPrivate* const p);
    ~ProjectDialogProvider() override;
    ProjectControllerPrivate* const d;

public Q_SLOTS:
    QUrl askProjectConfigLocation(bool fetch, const QUrl& startUrl,
                                  const QUrl& repoUrl, IPlugin* plugin) override;
    bool userWantsReopen() override;
};


}
#endif