Skip to content
Snippets Groups Projects
Commit 13232879 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Some reformatting to improve readability

parent ff3fe49a
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,6 @@
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <QtDebug>
using namespace GenericProjectManager;
using namespace GenericProjectManager::Internal;
......@@ -14,6 +12,7 @@ using namespace GenericProjectManager::Internal;
////////////////////////////////////////////////////////////////////////////////////////
// ProjectFilesEditable
////////////////////////////////////////////////////////////////////////////////////////
ProjectFilesFactory::ProjectFilesFactory(Manager *manager,
TextEditor::TextEditorActionHandler *handler)
: Core::IEditorFactory(manager),
......@@ -26,10 +25,13 @@ ProjectFilesFactory::ProjectFilesFactory(Manager *manager,
}
ProjectFilesFactory::~ProjectFilesFactory()
{ }
{
}
Manager *ProjectFilesFactory::manager() const
{ return _manager; }
{
return _manager;
}
Core::IEditor *ProjectFilesFactory::createEditor(QWidget *parent)
{
......@@ -39,10 +41,14 @@ Core::IEditor *ProjectFilesFactory::createEditor(QWidget *parent)
}
QStringList ProjectFilesFactory::mimeTypes() const
{ return _mimeTypes; }
{
return _mimeTypes;
}
QString ProjectFilesFactory::kind() const
{ return QLatin1String(Constants::FILES_EDITOR); }
{
return QLatin1String(Constants::FILES_EDITOR);
}
Core::IFile *ProjectFilesFactory::open(const QString &fileName)
{
......@@ -57,6 +63,7 @@ Core::IFile *ProjectFilesFactory::open(const QString &fileName)
////////////////////////////////////////////////////////////////////////////////////////
// ProjectFilesEditable
////////////////////////////////////////////////////////////////////////////////////////
ProjectFilesEditable::ProjectFilesEditable(ProjectFilesEditor *editor)
: TextEditor::BaseTextEditorEditable(editor)
{
......@@ -68,13 +75,19 @@ ProjectFilesEditable::~ProjectFilesEditable()
{ }
QList<int> ProjectFilesEditable::context() const
{ return _context; }
{
return _context;
}
const char *ProjectFilesEditable::kind() const
{ return Constants::FILES_EDITOR; }
{
return Constants::FILES_EDITOR;
}
bool ProjectFilesEditable::duplicateSupported() const
{ return true; }
{
return true;
}
Core::IEditor *ProjectFilesEditable::duplicate(QWidget *parent)
{
......@@ -83,13 +96,12 @@ Core::IEditor *ProjectFilesEditable::duplicate(QWidget *parent)
parentEditor->factory(),
parentEditor->actionHandler());
return editor->editableInterface();
}
////////////////////////////////////////////////////////////////////////////////////////
// ProjectFilesEditor
////////////////////////////////////////////////////////////////////////////////////////
ProjectFilesEditor::ProjectFilesEditor(QWidget *parent, ProjectFilesFactory *factory,
TextEditor::TextEditorActionHandler *handler)
: TextEditor::BaseTextEditor(parent),
......@@ -105,17 +117,24 @@ ProjectFilesEditor::~ProjectFilesEditor()
{ }
ProjectFilesFactory *ProjectFilesEditor::factory() const
{ return _factory; }
{
return _factory;
}
TextEditor::TextEditorActionHandler *ProjectFilesEditor::actionHandler() const
{ return _actionHandler; }
{
return _actionHandler;
}
TextEditor::BaseTextEditorEditable *ProjectFilesEditor::createEditableInterface()
{ return new ProjectFilesEditable(this); }
{
return new ProjectFilesEditable(this);
}
////////////////////////////////////////////////////////////////////////////////////////
// ProjectFilesDocument
////////////////////////////////////////////////////////////////////////////////////////
ProjectFilesDocument::ProjectFilesDocument(Manager *manager)
: _manager(manager)
{
......
......@@ -52,18 +52,25 @@ class PROJECTEXPLORER_EXPORT CustomExecutableRunConfiguration : public Applicati
// the configuration widget needs to setExecutable setWorkingDirectory and setCommandLineArguments
friend class Internal::CustomExecutableConfigurationWidget;
Q_OBJECT
public:
CustomExecutableRunConfiguration(Project *pro);
~CustomExecutableRunConfiguration();
virtual QString type() const;
// returns the executable,
// looks in the environment for it
// and might even ask the user if none is specified
/**
* Returns the executable, looks in the environment for it and might even
* ask the user if none is specified
*/
virtual QString executable() const;
// Returns only what is stored in the internal variable
// not what we might get after extending it with a path
// or asking the user. This value is needed for the configuration widget
/**
* Returns only what is stored in the internal variable, not what we might
* get after extending it with a path or asking the user. This value is
* needed for the configuration widget.
*/
QString baseExecutable() const;
virtual ApplicationRunConfiguration::RunMode runMode() const;
virtual QString workingDirectory() const;
QString baseWorkingDirectory() const;
......@@ -74,8 +81,10 @@ public:
virtual void restore(const PersistentSettingsReader &reader);
virtual QWidget *configurationWidget();
signals:
void changed();
private:
void setExecutable(const QString &executable);
void setCommandLineArguments(const QString &commandLineArguments);
......@@ -90,6 +99,7 @@ private:
class CustomExecutableRunConfigurationFactory : public IRunConfigurationFactory
{
Q_OBJECT
public:
CustomExecutableRunConfigurationFactory();
virtual ~CustomExecutableRunConfigurationFactory();
......@@ -101,11 +111,14 @@ public:
};
namespace Internal {
class CustomExecutableConfigurationWidget : public QWidget
{
Q_OBJECT
public:
CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc);
private slots:
void changed();
......@@ -113,6 +126,7 @@ private slots:
void setCommandLineArguments(const QString &commandLineArguments);
void setWorkingDirectory();
void termToggled(bool);
private:
bool m_ignoreChange;
CustomExecutableRunConfiguration *m_runConfiguration;
......@@ -121,7 +135,8 @@ private:
Core::Utils::PathChooser *m_workingDirectory;
QCheckBox *m_useTerminalCheck;
};
}
}
} // namespace Internal
} // namespace ProjectExplorer
#endif // CUSTOMEXECUTABLERUNCONFIGURATION_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment