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
|
/***************************************************************************
* Copyright (C) 2001-2002 by Bernd Gehrmann *
* bernd@kdevelop.org *
* *
* Copyright (C) 2002 by Victor R�er *
* victor_roeder@gmx.de *
* *
* 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 _AUTOPROJECTPART_H_
#define _AUTOPROJECTPART_H_
#include <qdict.h>
#include <qguardedptr.h>
#include <qmap.h>
#include <qdatetime.h>
#include <qdir.h>
#include <kdevgenericfactory.h>
#include "kdevbuildtool.h"
class QDomElement;
class QStringList;
class KDialogBase;
class AutoProjectWidget;
class KSelectAction;
class TargetItem;
class ConfigWidgetProxy;
class AutoProjectPart : public KDevBuildTool
{
Q_OBJECT
public:
AutoProjectPart( QObject *parent, const char *name, const QStringList &args );
virtual ~AutoProjectPart();
/**
* Implementation of the KDevProject interface.
*/
virtual QString projectDirectory() const;
virtual QString projectName() const;
virtual DomUtil::PairList runEnvironmentVars() const;
virtual QString runDirectory() const;
virtual QString mainProgram() const;
virtual QString debugArguments() const;
virtual QString runArguments() const;
virtual QString environString() const;
virtual QString activeDirectory() const;
virtual QStringList allFiles() const;
virtual void addFile( const QString &fileName );
virtual void addFiles ( const QStringList& fileList );
virtual void removeFile( const QString &fileName );
virtual void removeFiles ( const QStringList& fileList );
virtual QString buildDirectory() const;
virtual Options options() const;
/**
* Implementation of the KDevPlugin interface.
*/
virtual void restorePartialProjectSession ( const QDomElement* el );
virtual void savePartialProjectSession ( QDomElement* el );
/**
* automake specific methods.
*/
QStringList allBuildConfigs() const;
QString currentBuildConfig() const;
QString topsourceDirectory() const;
void startMakeCommand( const QString &dir, const QString &target, bool withKdesu = false );
void startSimpleMakeCommand( const QString &dir, const QString &command, bool withKdesu = false );
void buildTarget( QString relpath, TargetItem* titem );
void executeTarget( const QDir& dir, const TargetItem* titem );
void needMakefileCvs();
bool isDirty();
bool isKDE() const;
QStringList distFiles() const;
QString getAutoConfFile(const QString& dir);
protected:
/**
* Reimplemented from KDevProject. These methods are only
* for use by the application core.
*/
virtual void openProject( const QString &dirName, const QString &projectName );
virtual void closeProject();
private slots:
// void projectConfigWidget(KDialogBase *dlg);
void slotAddTranslation();
void slotBuild();
void slotBuildActiveTarget();
void slotCompileFile();
void slotClean();
void slotDistClean();
void slotInstall();
void slotInstallWithKdesu();
void slotMakefilecvs();
void slotMakeMessages();
void slotConfigure();
void slotExecute();
void slotExecute2();
void slotExecuteTargetAfterBuild( const QString& command );
void slotNotExecuteTargetAfterBuildFailed( const QString& command );
void slotBuildConfigChanged( const QString &config );
void slotBuildConfigAboutToShow();
void slotCommandFinished( const QString& command );
void slotCommandFailed( const QString& command );
//void slotImportExisting();
void insertConfigWidget( const KDialogBase* dlg, QWidget * page, unsigned int );
private:
QGuardedPtr<AutoProjectWidget> m_widget;
QString m_projectName;
QString m_projectPath;
KSelectAction *buildConfigAction;
QString makeEnvironment() const;
void setWantautotools();
QString makefileCvsCommand() const;
QString configureCommand() const;
QMap<QString, QDateTime> m_timestamp;
bool m_executeAfterBuild;
QString m_buildCommand;
bool m_needMakefileCvs;
bool m_lastCompilationFailed;
bool m_isKDE;
QPair<QDir, TargetItem*> m_executeTargetAfterBuild;
QString m_runProg;
ConfigWidgetProxy * _configProxy;
// Enble AutoProjectWidget to emit our signals
friend class AutoProjectWidget;
friend class AddSubprojectDialog;
friend class FileItem;
// For make commands queuing
QString constructMakeCommandLine( const QString &dir, const QString &target ) const;
bool queueInternalLibDependenciesBuild( TargetItem* titem, QStringList& list );
};
typedef KDevGenericFactory<AutoProjectPart> AutoProjectFactory;
#endif
// kate: indent-mode csands; tab-width 4;
|