Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AutoSave/AutoSaveDlg.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "AutoSaveDlg.h"

#include "AutoSaveSettings.h"

AutoSaveDlg::AutoSaveDlg(wxWindow* parent)
Expand Down
15 changes: 6 additions & 9 deletions AutoSave/autosave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
#include <wx/xrc/xmlres.h>

// Define the plugin entry point
CL_PLUGIN_API IPlugin* CreatePlugin(IManager* manager)
{
return new AutoSave(manager);
}
CL_PLUGIN_API IPlugin* CreatePlugin(IManager* manager) { return new AutoSave(manager); }

CL_PLUGIN_API PluginInfo* GetPluginInfo()
{
Expand Down Expand Up @@ -54,7 +51,7 @@ void AutoSave::UnPlug()
void AutoSave::OnSettings(wxCommandEvent& event)
{
AutoSaveDlg dlg(EventNotifier::Get()->TopFrame());
if(dlg.ShowModal() == wxID_OK) {
if (dlg.ShowModal() == wxID_OK) {
// Update the settings
UpdateTimers();
}
Expand All @@ -64,7 +61,7 @@ void AutoSave::UpdateTimers()
{
DeleteTimer();
AutoSaveSettings conf = AutoSaveSettings::Load();
if(!conf.HasFlag(AutoSaveSettings::kEnabled)) {
if (!conf.HasFlag(AutoSaveSettings::kEnabled)) {
return;
}

Expand All @@ -79,11 +76,11 @@ void AutoSave::OnTimer(wxTimerEvent& event)
m_mgr->GetAllEditors(editors);

// Save every modified editor
for(auto editor : editors) {
for (auto editor : editors) {
// Save modified files. However, don't attempt to try and save an "Untitled" document :/
bool local_file_and_exists = !editor->IsRemoteFile() && editor->GetFileName().FileExists();
bool is_remote = editor->IsRemoteFile();
if(editor->IsEditorModified() && (local_file_and_exists || is_remote)) {
if (editor->IsEditorModified() && (local_file_and_exists || is_remote)) {
editor->Save();
}
}
Expand All @@ -95,7 +92,7 @@ void AutoSave::OnTimer(wxTimerEvent& event)

void AutoSave::DeleteTimer()
{
if(m_timer) {
if (m_timer) {
Unbind(wxEVT_TIMER, &AutoSave::OnTimer, this);
m_timer->Stop();
}
Expand Down
3 changes: 2 additions & 1 deletion AutoSave/autosave.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define __AutoSave__

#include "plugin.h"

#include <wx/timer.h>

class AutoSave : public IPlugin
Expand All @@ -39,7 +40,7 @@ class AutoSave : public IPlugin

void UpdateTimers();
void DeleteTimer();

public:
AutoSave(IManager* manager);
~AutoSave() override = default;
Expand Down
8 changes: 4 additions & 4 deletions CMakePlugin/CMake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ CMake::CMake(const wxFileName& path)

wxArrayString CMake::GetVersions()
{
static const wxString VERSIONS[] = { "2.8.11", "2.8.10", "2.8.9", "2.8.8", "2.8.7", "2.8.6", "2.8.5",
"2.8.4", "2.8.3", "2.8.2", "2.8.1", "2.8.0", "2.6.4", "2.6.3",
"2.6.2", "2.6.1", "2.6.0", "2.4.8", "2.4.7", "2.4.6", "2.4.5",
"2.4.4", "2.4.3", "2.2.3", "2.0.6", "1.8.3" };
static const wxString VERSIONS[] = {"2.8.11", "2.8.10", "2.8.9", "2.8.8", "2.8.7", "2.8.6", "2.8.5",
"2.8.4", "2.8.3", "2.8.2", "2.8.1", "2.8.0", "2.6.4", "2.6.3",
"2.6.2", "2.6.1", "2.6.0", "2.4.8", "2.4.7", "2.4.6", "2.4.5",
"2.4.4", "2.4.3", "2.2.3", "2.0.6", "1.8.3"};

return wxArrayString(sizeof(VERSIONS) / sizeof(VERSIONS[0]), VERSIONS);
}
Expand Down
6 changes: 3 additions & 3 deletions CMakePlugin/CMake.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
#include <map>

// wxWidgets
#include <wx/string.h>
#include <wx/filename.h>
#include <wx/arrstr.h>
#include <wx/vector.h>
#include <wx/filename.h>
#include <wx/progdlg.h>
#include <wx/string.h>
#include <wx/vector.h>
#include <wx/wxsqlite3.h>

/* ************************************************************************ */
Expand Down
43 changes: 28 additions & 15 deletions CMakePlugin/CMakeBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ CMakeBuilder::CMakeBuilder()
{
}

bool CMakeBuilder::Export(const wxString& project, const wxString& confToBuild, const wxString& arguments,
bool isProjectOnly, bool force, wxString& errMsg)
bool CMakeBuilder::Export(const wxString& project,
const wxString& confToBuild,
const wxString& arguments,
bool isProjectOnly,
bool force,
wxString& errMsg)
{
wxUnusedVar(project);
wxUnusedVar(confToBuild);
Expand Down Expand Up @@ -38,40 +42,45 @@ wxString CMakeBuilder::GetBuildCommand(const wxString& project, const wxString&
return command;
}

wxString CMakeBuilder::GetPOCleanCommand(const wxString& project, const wxString& confToBuild,
const wxString& arguments)
wxString
CMakeBuilder::GetPOCleanCommand(const wxString& project, const wxString& confToBuild, const wxString& arguments)
{
wxString command;
command << "cd " << GetProjectBuildFolder(project, true) << " && " << GetBuildToolCommand(project, confToBuild)
<< " clean";
return command;
}

wxString CMakeBuilder::GetPOBuildCommand(const wxString& project, const wxString& confToBuild,
const wxString& arguments)
wxString
CMakeBuilder::GetPOBuildCommand(const wxString& project, const wxString& confToBuild, const wxString& arguments)
{
wxString command;
command << "cd " << GetProjectBuildFolder(project, true) << " && " << GetBuildToolCommand(project, confToBuild);
return command;
}

wxString CMakeBuilder::GetPORebuildCommand(const wxString& project, const wxString& confToBuild,
const wxString& arguments)
wxString
CMakeBuilder::GetPORebuildCommand(const wxString& project, const wxString& confToBuild, const wxString& arguments)
{
wxString command;
command << "cd " << GetProjectBuildFolder(project, true) << " && " << GetBuildToolCommand(project, confToBuild)
<< " clean all";
return command;
}

wxString CMakeBuilder::GetSingleFileCmd(const wxString& project, const wxString& confToBuild, const wxString& arguments,
wxString CMakeBuilder::GetSingleFileCmd(const wxString& project,
const wxString& confToBuild,
const wxString& arguments,
const wxString& fileName)
{
return wxEmptyString;
}

wxString CMakeBuilder::GetPreprocessFileCmd(const wxString& project, const wxString& confToBuild,
const wxString& arguments, const wxString& fileName, wxString& errMsg)
wxString CMakeBuilder::GetPreprocessFileCmd(const wxString& project,
const wxString& confToBuild,
const wxString& arguments,
const wxString& fileName,
wxString& errMsg)
{
return wxEmptyString;
}
Expand All @@ -83,7 +92,9 @@ wxString CMakeBuilder::GetWorkspaceBuildFolder(bool wrapWithQuotes)

fn.AppendDir(CMAKE_BUILD_FOLDER_PREFIX + workspaceConfig);
wxString folder = fn.GetPath();
if(wrapWithQuotes) { StringUtils::WrapWithQuotes(folder); }
if (wrapWithQuotes) {
StringUtils::WrapWithQuotes(folder);
}
return folder;
}

Expand All @@ -107,14 +118,16 @@ wxString CMakeBuilder::GetProjectBuildFolder(const wxString& project, bool wrapW
wxString CMakeBuilder::GetBuildToolCommand(const wxString& project, const wxString& confToBuild) const
{
BuildConfigPtr bldConf = clCxxWorkspaceST::Get()->GetProjBuildConf(project, confToBuild);
if(!bldConf) return wxEmptyString;
if (!bldConf)
return wxEmptyString;

// The 'make' command is part of the compiler settings
CompilerPtr compiler = bldConf->GetCompiler();
if(!compiler) return wxEmptyString;
if (!compiler)
return wxEmptyString;

wxString buildTool = compiler->GetTool("MAKE");
if(buildTool.Lower().Contains("make")) {
if (buildTool.Lower().Contains("make")) {
return buildTool + " -e ";

} else {
Expand Down
25 changes: 17 additions & 8 deletions CMakePlugin/CMakeBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ class CMakeBuilder : public Builder
* \param errMsg output
* \return true on success, false otherwise.
*/
virtual bool Export(const wxString& project, const wxString& confToBuild, const wxString& arguments,
bool isProjectOnly, bool force, wxString& errMsg);
virtual bool Export(const wxString& project,
const wxString& confToBuild,
const wxString& arguments,
bool isProjectOnly,
bool force,
wxString& errMsg);

/**
* Return the command that should be executed for performing the clean
Expand Down Expand Up @@ -60,8 +64,10 @@ class CMakeBuilder : public Builder
* \param errMsg [output]
* \return the command
*/
virtual wxString GetSingleFileCmd(
const wxString& project, const wxString& confToBuild, const wxString& arguments, const wxString& fileName);
virtual wxString GetSingleFileCmd(const wxString& project,
const wxString& confToBuild,
const wxString& arguments,
const wxString& fileName);

/**
* \brief create a command to execute for preprocessing single source file
Expand All @@ -70,17 +76,20 @@ class CMakeBuilder : public Builder
* \param errMsg [output]
* \return the command
*/
virtual wxString GetPreprocessFileCmd(const wxString& project, const wxString& confToBuild,
const wxString& arguments, const wxString& fileName, wxString& errMsg);
virtual wxString GetPreprocessFileCmd(const wxString& project,
const wxString& confToBuild,
const wxString& arguments,
const wxString& fileName,
wxString& errMsg);

/**
* @brief return the 'rebuild' command
* @param project
* @param confToBuild
* @return
*/
virtual wxString GetPORebuildCommand(
const wxString& project, const wxString& confToBuild, const wxString& arguments);
virtual wxString
GetPORebuildCommand(const wxString& project, const wxString& confToBuild, const wxString& arguments);
};

#endif // CMAKEBUILDER_H
2 changes: 1 addition & 1 deletion CMakePlugin/CMakeConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
/* ************************************************************************ */

// wxWidgets
#include <wx/string.h>
#include <wx/fileconf.h>
#include <wx/string.h>

/* ************************************************************************ */
/* CLASSES */
Expand Down
Loading
Loading