summaryrefslogtreecommitdiff
path: root/plugins/Sessions/Src/Main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-03-15 14:50:41 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-03-15 14:50:41 +0300
commitd5320ae89a2e725013fed19c7a2c1dbfd75135a7 (patch)
tree9b29a3369b0e2a14a427aca7725b448d5d51b91d /plugins/Sessions/Src/Main.cpp
parente4f25e2f1f5ecad84a8900b056be90d0c2ccf559 (diff)
fixes #3428 (Sessions: опция "сохранять X сессий" недоступна для ручного редактирования)
fixes #3422 (Sessions: падение при удалении несуществующей сессии)
Diffstat (limited to 'plugins/Sessions/Src/Main.cpp')
-rw-r--r--plugins/Sessions/Src/Main.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index 9bf7a0e20e..4489df8646 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -25,7 +25,6 @@ OBJLIST<CSession> g_arUserSessions(1, NumericKeySortT), g_arDateSessions(1, Nume
HANDLE hmTBButton[2], hiTBbutton[2], iTBbutton[2];
-int g_ses_limit;
int g_lastUserId, g_lastDateId;
bool g_bExclHidden;
@@ -64,7 +63,13 @@ PLUGININFOEX pluginInfoEx =
CMPlugin::CMPlugin() :
PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx),
g_lastUserId(MODULENAME, "LastUserId", 0),
- g_lastDateId(MODULENAME, "LastDateId", 0)
+ g_lastDateId(MODULENAME, "LastDateId", 0),
+ bExclHidden(MODULENAME, "ExclHidden", false),
+ bWarnOnHidden(MODULENAME, "WarnOnHidden", false),
+ bOtherWarnings(MODULENAME, "OtherWarnings", true),
+ bCrashRecovery(MODULENAME, "CrashRecovery", false),
+ iTrackCount(MODULENAME, "TrackCount", 10),
+ iStartupDelay(MODULENAME, "StartupModeDelay", 1500)
{}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -116,7 +121,7 @@ static void SaveDateSession()
mir_snprintf(szSetting, "%s_%d", "SessionDate", int(g_plugin.g_lastDateId));
g_plugin.setUString(szSetting, data.toString().c_str());
- while (g_arDateSessions.getCount() >= g_ses_limit) {
+ while (g_arDateSessions.getCount() >= g_plugin.iTrackCount) {
mir_snprintf(szSetting, "%s_%d", "SessionDate", g_arDateSessions[0].id);
g_plugin.delSetting(szSetting);
g_arDateSessions.remove(int(0));
@@ -389,7 +394,6 @@ int CMPlugin::Load()
Miranda_WaitOnHandle(LaunchSessions);
// Settimgs
- g_ses_limit = g_plugin.getByte("TrackCount", 10);
g_bExclHidden = g_plugin.getByte("ExclHidden", 0) != 0;
g_bWarnOnHidden = g_plugin.getByte("WarnOnHidden", 0) != 0;
g_bOtherWarnings = g_plugin.getByte("OtherWarnings", 1) != 0;