summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2014-09-18 19:43:57 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2014-09-18 19:43:57 +0000
commitdb4e6bcb736ee6b602e471cbd91425bca9a005f1 (patch)
treedc335aaa7dba1f35d3caef0f0961308cef4173e0
parentc72e3f9fe11a3d6b72a04af599b04fde82091dd5 (diff)
Core: If database setting FirstRun/ForceShowAccManager = b1 exists, the accounts manager will be opened and that setting will be deleted.
Useful for pack creators to get rid of FirstRun Plugin git-svn-id: http://svn.miranda-ng.org/main/trunk@10510 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--src/modules/protocols/protoaccs.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index e5142abb10..9f7dc933ee 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -67,9 +67,9 @@ void LoadDbAccounts(void)
{
DBVARIANT dbv;
int ver = db_get_dw(NULL, "Protocols", "PrVer", -1);
- int count = db_get_dw(NULL, "Protocols", "ProtoCount", 0), i;
+ int count = db_get_dw(NULL, "Protocols", "ProtoCount", 0);
- for (i=0; i < count; i++) {
+ for (int i=0; i < count; i++) {
char buf[10];
_itoa(i, buf, 10);
if (db_get_s(NULL, "Protocols", buf, &dbv))
@@ -151,8 +151,6 @@ static int enumDB_ProtoProc(const char* szSetting, LPARAM lParam)
void WriteDbAccounts()
{
- int i;
-
// enum all old settings to delete
enumDB_ProtoProcParam param = { 0, NULL };
@@ -165,8 +163,7 @@ void WriteDbAccounts()
// delete all settings
if (param.arrlen) {
- int i;
- for (i=0; i < param.arrlen; i++) {
+ for (int i=0; i < param.arrlen; i++) {
db_unset(0, "Protocols", param.pszSettingName[i]);
mir_free(param.pszSettingName[i]);
}
@@ -174,7 +171,7 @@ void WriteDbAccounts()
}
// write new data
- for (i=0; i < accounts.getCount(); i++) {
+ for (int i=0; i < accounts.getCount(); i++) {
PROTOACCOUNT *pa = accounts[i];
char buf[ 20 ];
@@ -242,6 +239,11 @@ static int InitializeStaticAccounts(WPARAM, LPARAM)
db_set_b(NULL, "FirstRun", "AccManager", 1);
CallService(MS_PROTO_SHOWACCMGR, 0, 0);
}
+ // This is for pack creators with a profile with predefined accounts
+ else if(db_get_b(NULL, "FirstRun", "ForceShowAccManager", 0)) {
+ CallService(MS_PROTO_SHOWACCMGR, 0, 0);
+ db_unset(NULL, "FirstRun", "ForceShowAccManager");
+ }
return 0;
}