~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to buildtools/custommakefiles/customprojectpart.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright (C) 2001-2002 by Bernd Gehrmann                             *
3
 
 *   bernd@kdevelop.org                                                    *
4
 
 *   Copyright (C) 2007 by Andreas Pakulat                                 *
5
 
 *   apaku@gmx.de                                                          *
6
 
 *                                                                         *
7
 
 *   This program is free software; you can redistribute it and/or modify  *
8
 
 *   it under the terms of the GNU General Public License as published by  *
9
 
 *   the Free Software Foundation; either version 2 of the License, or     *
10
 
 *   (at your option) any later version.                                   *
11
 
 *                                                                         *
12
 
 ***************************************************************************/
13
 
 
14
 
#ifndef _CUSTOMPROJECTPART_H_
15
 
#define _CUSTOMPROJECTPART_H_
16
 
 
17
 
#include <qdict.h>
18
 
#include <qguardedptr.h>
19
 
#include <qmap.h>
20
 
#include <qdatetime.h>
21
 
#include <qvaluestack.h>
22
 
 
23
 
#include <kdevbuildtool.h>
24
 
 
25
 
class QListViewItem;
26
 
class QPopupMenu;
27
 
class QStringList;
28
 
class KDialogBase;
29
 
class CustomProjectWidget;
30
 
class Context;
31
 
class KSelectAction;
32
 
 
33
 
class CustomProjectPart : public KDevBuildTool
34
 
{
35
 
    Q_OBJECT
36
 
 
37
 
public:
38
 
    CustomProjectPart( QObject *parent, const char *name, const QStringList & );
39
 
    ~CustomProjectPart();
40
 
 
41
 
    QStringList allMakeEnvironments() const;
42
 
    QString currentMakeEnvironment() const;
43
 
 
44
 
    bool isDirty();
45
 
    QStringList distFiles() const;
46
 
 
47
 
    virtual void openProject( const QString &dirName, const QString &projectName );
48
 
    virtual void closeProject();
49
 
 
50
 
    virtual QString projectDirectory() const;
51
 
    virtual QString projectName() const;
52
 
    virtual QString mainProgram() const;
53
 
    virtual QString activeDirectory() const;
54
 
    virtual QStringList allFiles() const;
55
 
    virtual void addFile( const QString &fileName );
56
 
    virtual void addFiles( const QStringList& fileList );
57
 
    virtual void removeFile( const QString &fileName );
58
 
    virtual void removeFiles( const QStringList &fileList );
59
 
    virtual QString buildDirectory() const;
60
 
    virtual QString runDirectory() const;
61
 
    virtual QString debugArguments() const;
62
 
    virtual QString runArguments() const;
63
 
    virtual DomUtil::PairList runEnvironmentVars() const;
64
 
    QString relativeToProject( const QString& ) const;
65
 
 
66
 
 
67
 
private slots:
68
 
    void populateProject();
69
 
    void projectConfigWidget( KDialogBase *dlg );
70
 
    void contextMenu( QPopupMenu *popup, const Context *context );
71
 
    void slotAddToProject();
72
 
    void slotRemoveFromProject();
73
 
    void slotAddToProjectRecursive();
74
 
    void slotRemoveFromProjectRecursive();
75
 
    void addNewFilesToProject( const QStringList& );
76
 
    void slotChangeBlacklist();
77
 
    void slotChooseActiveDirectory();
78
 
    void slotBuild();
79
 
    void slotBuildActiveDir();
80
 
    void slotCompileFile();
81
 
    void slotInstall();
82
 
    void slotInstallActiveDir();
83
 
    void slotInstallWithKdesu();
84
 
    void slotClean();
85
 
    void slotExecute();
86
 
    void updateTargetMenu();
87
 
    void targetMenuActivated( int id );
88
 
    void targetObjectFilesMenuActivated( int id );
89
 
    void targetOtherFilesMenuActivated( int id );
90
 
    void updateMakeEnvironmentsMenu();
91
 
    void makeEnvironmentsMenuActivated( int id );
92
 
    void slotCommandFinished( const QString& command );
93
 
    void slotCommandFailed( const QString& command );
94
 
 
95
 
private:
96
 
    bool containsNonProjectFiles( const QString& url );
97
 
    QStringList projectFilesInDir( const QString& dir );
98
 
    bool containsProjectFiles( const QString& url );
99
 
    bool isProjectFileType( const QString& absFile ) const;
100
 
    bool isInBlacklist( const QString& ) const;
101
 
    void cleanFileList();
102
 
    void setFiletypes( const QStringList& );
103
 
    void findNewFiles( const QString& dir, QStringList& list) const;
104
 
 
105
 
    QStringList filetypes() const;
106
 
    QStringList blacklist() const;
107
 
    void updateBlacklist( const QStringList& );
108
 
    void saveProject();
109
 
    void startMakeCommand( const QString &dir, const QString &target, bool withKdesu = false );
110
 
    void parseMakefile( const QString& file );
111
 
    QString makeEnvironment() const;
112
 
    void putEnvVarsInVarMap();
113
 
    void switchBlacklistEntry(const QString& );
114
 
 
115
 
    bool isInProject( const QString& fileName ) const;
116
 
    void addToProject( const QString& fileName );
117
 
    void removeFromProject( const QString& fileName );
118
 
 
119
 
    /**
120
 
     * @brief Set of all the project's files.
121
 
     *
122
 
     * @bug
123
 
     * Due to deficiency in QT3,
124
 
     * we have to use a map with next-to-useless element value,
125
 
     * keyed by the file name,
126
 
     * as a set-container replacement.
127
 
     */
128
 
    typedef QMap<QString, bool> ProjectFilesSet;
129
 
 
130
 
    QString m_projectDirectory;
131
 
    QString m_projectName;
132
 
    QString m_filelistDir;
133
 
    /** All the sources (files and directories) of this project. */
134
 
    ProjectFilesSet m_sourceFilesSet;
135
 
    QPopupMenu *m_targetMenu;
136
 
    QPopupMenu *m_targetObjectFilesMenu;
137
 
    QPopupMenu *m_targetOtherFilesMenu;
138
 
    KSelectAction *m_makeEnvironmentsSelector;
139
 
    QStringList m_targets;
140
 
    QStringList m_targetsObjectFiles;
141
 
    QStringList m_targetsOtherFiles;
142
 
    QStringList m_contextAddFiles;
143
 
    QStringList m_contextRemoveFiles;
144
 
    QString m_contextDirName;
145
 
 
146
 
    QMap<QString, QDateTime> m_timestamp;
147
 
    bool m_executeAfterBuild;
148
 
    QString m_buildCommand;
149
 
    bool m_lastCompilationFailed;
150
 
    QMap<QString, int> m_parsedMakefiles;
151
 
    QValueStack<QString> m_makefilesToParse;
152
 
    QMap<QString, QString> m_makefileVars;
153
 
    bool m_recursive;
154
 
    bool m_first_recursive;
155
 
};
156
 
 
157
 
#endif
158
 
// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on