no more SetAppName/SetVendor in the config classes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2063 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -14,43 +14,32 @@
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "confbase.h"
|
||||
#pragma implementation "confbase.h"
|
||||
#endif
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include <wx/confbase.h>
|
||||
|
||||
#if wxUSE_CONFIG
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif //__BORLANDC__
|
||||
|
||||
#include <wx/app.h>
|
||||
#include <wx/file.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/textfile.h>
|
||||
#include <wx/utils.h>
|
||||
#include "wx/app.h"
|
||||
#include "wx/file.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/textfile.h"
|
||||
#include "wx/utils.h"
|
||||
|
||||
// we must include (one of) these files for wxConfigBase::Create
|
||||
#if defined(__WXMSW__) && defined(wxCONFIG_WIN32_NATIVE)
|
||||
#ifdef __WIN32__
|
||||
#include <wx/msw/regconf.h>
|
||||
#else //WIN16
|
||||
#include <wx/msw/iniconf.h>
|
||||
#endif
|
||||
#else // either we're under Unix or wish to use files even under Windows
|
||||
#include <wx/fileconf.h>
|
||||
#endif
|
||||
#include "wx/config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <ctype.h> // for isalnum()
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <ctype.h> // for isalnum()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global and class static variables
|
||||
@@ -413,7 +402,5 @@ void wxSplitPath(wxArrayString& aParts, const char *sz)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// wxUSE_CONFIG
|
||||
#endif // wxUSE_CONFIG
|
||||
|
||||
|
@@ -198,15 +198,11 @@ void wxFileConfig::Init()
|
||||
wxFileConfig::wxFileConfig(const wxString& appName, const wxString& vendorName,
|
||||
const wxString& strLocal, const wxString& strGlobal,
|
||||
long style)
|
||||
: wxConfigBase(appName, vendorName, strLocal, strGlobal, style),
|
||||
: wxConfigBase(!appName && wxTheApp ? wxTheApp->GetAppName()
|
||||
: appName,
|
||||
vendorName, strLocal, strGlobal, style),
|
||||
m_strLocalFile(strLocal), m_strGlobalFile(strGlobal)
|
||||
{
|
||||
// Make up an application name if not supplied
|
||||
if (appName.IsEmpty() && wxTheApp)
|
||||
{
|
||||
SetAppName(wxTheApp->GetAppName());
|
||||
}
|
||||
|
||||
// Make up names for files if empty
|
||||
if ( m_strLocalFile.IsEmpty() && (style & wxCONFIG_USE_LOCAL_FILE) )
|
||||
{
|
||||
@@ -1106,18 +1102,11 @@ bool ConfigGroup::DeleteSubgroup(ConfigGroup *pGroup)
|
||||
}
|
||||
|
||||
// and subgroups of this sungroup
|
||||
#if 0
|
||||
// pGroup->m_aSubgroups.Count() gets decremented in DeleteSubgroup(),
|
||||
// so we cannot do this.
|
||||
|
||||
nCount = pGroup->m_aSubgroups.Count();
|
||||
for ( size_t nGroup = 0; nGroup < nCount; nGroup++ ) {
|
||||
pGroup->DeleteSubgroup(pGroup->m_aSubgroups[nGroup]);
|
||||
pGroup->DeleteSubgroup(pGroup->m_aSubgroups[0]);
|
||||
}
|
||||
#endif
|
||||
while(pGroup->m_aSubgroups.Count() > 0)
|
||||
pGroup->DeleteSubgroup(pGroup->m_aSubgroups[0]);
|
||||
|
||||
|
||||
LineList *pLine = pGroup->m_pLine;
|
||||
if ( pLine != NULL ) {
|
||||
// notice that we may do this test inside the previous "if" because the
|
||||
|
@@ -2,7 +2,7 @@
|
||||
// Name: src/msw/iniconf.cpp
|
||||
// Purpose: implementation of wxIniConfig class
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Modified by:
|
||||
// Created: 27.07.98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
@@ -55,31 +55,18 @@
|
||||
// ctor & dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxIniConfig::wxIniConfig(const wxString& strAppName, const wxString& strVendor,
|
||||
const wxString& localFilename, const wxString& globalFilename, long style):
|
||||
wxConfigBase(strAppName, strVendor, localFilename, globalFilename, style)
|
||||
wxIniConfig::wxIniConfig(const wxString& strAppName,
|
||||
const wxString& strVendor,
|
||||
const wxString& localFilename,
|
||||
const wxString& globalFilename,
|
||||
long style)
|
||||
: wxConfigBase(!appName && wxTheApp ? wxTheApp->GetAppName()
|
||||
: appName,
|
||||
!vendorName ? (wxTheApp ? wxTheApp->GetVendorName()
|
||||
: appName)
|
||||
: vendorName,
|
||||
strLocal, strGlobal, style),
|
||||
{
|
||||
if ( GetAppName().IsEmpty() )
|
||||
{
|
||||
wxString app;
|
||||
if (wxTheApp)
|
||||
app = wxTheApp->GetAppName();
|
||||
wxASSERT( !app.IsEmpty() );
|
||||
SetAppName(app);
|
||||
}
|
||||
|
||||
// Vendor name is required in wxIniConfig.
|
||||
// TODO: should it be required? Why isn't appName used instead? -- JACS
|
||||
if ( GetVendorName().IsEmpty() )
|
||||
{
|
||||
wxString vendor;
|
||||
if (wxTheApp)
|
||||
vendor = wxTheApp->GetVendorName();
|
||||
else
|
||||
vendor = strAppName;
|
||||
SetVendorName(vendor);
|
||||
}
|
||||
|
||||
m_strLocalFilename = localFilename;
|
||||
if (m_strLocalFilename.IsEmpty())
|
||||
{
|
||||
@@ -304,7 +291,7 @@ bool wxIniConfig::Read(const wxString& szKey, wxString *pstr) const
|
||||
return FALSE;
|
||||
}
|
||||
else {
|
||||
*pstr = szBuf ;
|
||||
*pstr = szBuf ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -333,7 +320,7 @@ bool wxIniConfig::Read(const wxString& szKey, wxString *pstr,
|
||||
return FALSE;
|
||||
}
|
||||
else {
|
||||
*pstr = szBuf ;
|
||||
*pstr = szBuf ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -431,7 +418,7 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey)
|
||||
{
|
||||
wxConfigPathChanger path(this, szKey);
|
||||
|
||||
// passing NULL as section name to WritePrivateProfileString deletes the
|
||||
// passing NULL as section name to WritePrivateProfileString deletes the
|
||||
// whole section according to the docs
|
||||
bool bOk = WritePrivateProfileString(path.Name(), NULL,
|
||||
NULL, m_strLocalFilename) != 0;
|
||||
|
Reference in New Issue
Block a user