Skip to content

Commit 134b106

Browse files
committed
Fix Remoty Persist Config Updates
Fixed a call to `AddObject` with an empty string which does not make sense as it will return `JSONItem{nullptr}`. **Generated by CodeLite** Signed-off-by: Eran Ifrah <eran@codelite.org>
1 parent 3f9ae4d commit 134b106

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CodeLite/cl_config.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#include "FontUtils.hpp"
2929
#include "cl_standard_paths.h"
30+
#include "file_logger.h"
3031
#include "fileutils.h"
3132

3233
#include <wx/filefn.h>

Remoty/RemotyConfig.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "RemotyConfig.hpp"
22

33
#include "cl_config.h"
4+
#include "file_logger.h"
45

56
#include <algorithm>
67

@@ -52,14 +53,18 @@ void RemotyConfig::UpdateRecentWorkspaces(const RemoteWorkspaceInfo& workspaceIn
5253

5354
// serialise the items
5455
clConfig::Get().Write(REMOTY_RECENT_WORKSPACES, [&curitems]() -> JSONItem {
56+
clDEBUG() << "Writing remote workspaces to disk" << endl;
5557
JSONItem arr = JSONItem::createArray();
5658
for (const auto& wi : curitems) {
57-
auto d = arr.AddObject(wxEmptyString);
59+
auto d = JSONItem::createObject();
5860
d.addProperty("account", wi.account);
5961
d.addProperty("path", wi.path);
62+
arr.arrayAppend(std::move(d));
6063
}
64+
clDEBUG() << "Array content:" << arr.FormatRawString() << endl;
6165
return arr;
6266
});
67+
clConfig::Get().Save();
6368
}
6469

6570
bool RemotyConfig::IsOpenWorkspaceTypeLocal() const { return clConfig::Get().Read(REMOTY_OPEN_WORKSPACE_TYPE, true); }

SFTP/sftp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ CL_PLUGIN_API PluginInfo* GetPluginInfo()
7676
static PluginInfo info;
7777
info.SetAuthor(wxT("Eran Ifrah"));
7878
info.SetName(wxT("SFTP"));
79-
info.SetDescription(_("SFTP plugin for codelite IDE"));
79+
info.SetDescription(_("SFTP plugin for CodeLite IDE"));
8080
info.SetVersion(wxT("v1.0"));
8181
return &info;
8282
}
@@ -86,7 +86,7 @@ CL_PLUGIN_API int GetPluginInterfaceVersion() { return PLUGIN_INTERFACE_VERSION;
8686
SFTP::SFTP(IManager* manager)
8787
: IPlugin(manager)
8888
{
89-
m_longName = _("SFTP plugin for codelite IDE");
89+
m_longName = _("SFTP plugin for CodeLite IDE");
9090
m_shortName = wxT("SFTP");
9191

9292
wxTheApp->Connect(

0 commit comments

Comments
 (0)