diff options
| author | Tobias Weimer <wishmaster51@googlemail.com> | 2013-09-22 10:48:53 +0000 | 
|---|---|---|
| committer | Tobias Weimer <wishmaster51@googlemail.com> | 2013-09-22 10:48:53 +0000 | 
| commit | a1c5c899cd1010db56c9fe35be716fbc7236f447 (patch) | |
| tree | a9b373987538daa3f35f7231d5486622269b44ca /plugins/SplashScreen/src | |
| parent | 7b66065acf50e9c107a5c1df2a9afafb053f91f9 (diff) | |
fixed reading strings from db
git-svn-id: http://svn.miranda-ng.org/main/trunk@6178 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SplashScreen/src')
| -rw-r--r-- | plugins/SplashScreen/src/main.cpp | 24 | ||||
| -rw-r--r-- | plugins/SplashScreen/src/options.cpp | 32 | 
2 files changed, 23 insertions, 33 deletions
diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index 72a827901f..4dc31a6f1d 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -113,27 +113,22 @@ void SplashMain()  			}
  		}
 -		//for 9x "alfa" testing
  		DBVARIANT dbv = {0};
 -		db_get_ts(NULL, MODNAME, "VersionPrefix", &dbv);
 -		if (lstrcmp(dbv.ptszVal, NULL) == 0)
 +		if (!db_get_ts(NULL, MODNAME, "VersionPrefix", &dbv))
  		{
 -			_tcscpy_s(szPrefix, _T(""));
 +			_tcscpy_s(szPrefix, dbv.ptszVal);
  			db_free(&dbv);
  		}
  		else
 -			_tcscpy_s(szPrefix, dbv.ptszVal);
 -		dbv.ptszVal = NULL;
 +			_tcscpy_s(szPrefix, _T(""));
 -		db_get_ts(NULL, MODNAME, "Path", &dbv);
 -		if (lstrcmp(dbv.ptszVal, NULL) == 0)
 +		if (!db_get_ts(NULL, MODNAME, "Path", &dbv))
  		{
 -			_tcscpy_s(inBuf, _T("splash\\splash.png"));
 +			_tcscpy_s(inBuf, dbv.ptszVal);
  			db_free(&dbv);
  		}
  		else
 -			_tcscpy_s(inBuf, dbv.ptszVal);
 -		dbv.ptszVal = NULL;
 +			_tcscpy_s(inBuf, _T("splash\\splash.png"));
  		TCHAR szExpandedSplashFile[MAX_PATH];
  		ExpandEnvironmentStrings(inBuf, szExpandedSplashFile, SIZEOF(szExpandedSplashFile));
 @@ -146,14 +141,13 @@ void SplashMain()  		else
  			_tcscpy_s(szSplashFile, inBuf);
 -		db_get_ts(NULL, MODNAME, "Sound", &dbv);
 -		if (lstrcmp(dbv.ptszVal, NULL) == 0)
 +		if (!db_get_ts(NULL, MODNAME, "Sound", &dbv))
  		{
 -			_tcscpy_s(inBuf, _T("sounds\\startup.wav"));
 +			_tcscpy_s(inBuf, dbv.ptszVal);
  			db_free(&dbv);
  		}
  		else
 -			_tcscpy_s(inBuf, dbv.ptszVal);
 +			_tcscpy_s(inBuf, _T("sounds\\startup.wav"));
  		TCHAR szExpandedSoundFile[MAX_PATH];
  		ExpandEnvironmentStrings(inBuf, szExpandedSoundFile, SIZEOF(szExpandedSoundFile));
 diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp index 156974c7ed..ddbaadc001 100644 --- a/plugins/SplashScreen/src/options.cpp +++ b/plugins/SplashScreen/src/options.cpp @@ -68,37 +68,33 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP  				ReadDbConfig();
  				TCHAR inBuf[80];
  				DBVARIANT dbv = {0};
 -				db_get_ts(NULL, MODNAME, "Path", &dbv);
 -				if (lstrcmp(dbv.ptszVal, NULL) == 0)
 +				if (!db_get_ts(NULL, MODNAME, "Path", &dbv))
  				{
 -					_tcscpy_s(inBuf, _T("splash\\splash.png"));
 +					_tcscpy_s(inBuf, dbv.ptszVal);
  					db_free(&dbv);
  				}
  				else
 -					_tcscpy_s(inBuf, dbv.ptszVal);
 -				dbv.ptszVal = NULL;
 -				SetWindowText(GetDlgItem(hwndDlg, IDC_SPLASHPATH),inBuf);
 -				db_get_ts(NULL, MODNAME, "Sound", &dbv);
 -				if (lstrcmp(dbv.ptszVal, NULL) == 0)
 +					_tcscpy_s(inBuf, _T("splash\\splash.png"));
 +				SetDlgItemText(hwndDlg, IDC_SPLASHPATH, inBuf);
 +
 +				if (!db_get_ts(NULL, MODNAME, "Sound", &dbv))
  				{
 -					_tcscpy_s(inBuf, _T("sounds\\startup.wav"));
 +					_tcscpy_s(inBuf, dbv.ptszVal);
  					db_free(&dbv);
  				}
  				else
 -					_tcscpy_s(inBuf, dbv.ptszVal);
 -				dbv.ptszVal = NULL;
 -				SetWindowText(GetDlgItem(hwndDlg, IDC_SNDPATH),inBuf);
 +					_tcscpy_s(inBuf, _T("sounds\\startup.wav"));
 +				SetDlgItemText(hwndDlg, IDC_SNDPATH, inBuf);
 -				db_get_ts(NULL, MODNAME, "VersionPrefix", &dbv);
 -				if (lstrcmp(dbv.ptszVal, NULL) == 0)
 +				if (!db_get_ts(NULL, MODNAME, "VersionPrefix", &dbv))
  				{
 -					_tcscpy_s(inBuf, _T(""));
 +					_tcscpy_s(inBuf, dbv.ptszVal);
  					db_free(&dbv);
  				}
  				else
 -					_tcscpy_s(inBuf, dbv.ptszVal);
 -				dbv.ptszVal = NULL;
 -				SetWindowText(GetDlgItem(hwndDlg, IDC_VERSIONPREFIX), inBuf);
 +					_tcscpy_s(inBuf, _T(""));
 +				SetDlgItemText(hwndDlg, IDC_VERSIONPREFIX, inBuf);
 +
  				if (options.active)
  					CheckDlgButton(hwndDlg, IDC_ACTIVE, BST_CHECKED);
  				if (options.playsnd && !options.inheritGS)
  | 
