@ -62,6 +62,12 @@ Wizard::MainWizard::MainWizard(QWidget *parent) :
setupLauncherSettings ( ) ;
setupInstallations ( ) ;
setupPages ( ) ;
const boost : : filesystem : : path & installedPath = mCfgMgr . getInstallPath ( ) ;
if ( ! installedPath . empty ( ) )
{
addInstallation ( toQString ( installedPath ) ) ;
}
}
Wizard : : MainWizard : : ~ MainWizard ( )
@ -71,7 +77,7 @@ Wizard::MainWizard::~MainWizard()
void Wizard : : MainWizard : : setupLog ( )
{
QString logPath ( QString: : fromUtf8 ( mCfgMgr . getLogPath ( ) . string ( ) . c_str ( ) ) ) ;
QString logPath ( to QString( mCfgMgr . getLogPath ( ) ) ) ;
logPath . append ( QLatin1String ( " wizard.log " ) ) ;
QFile file ( logPath ) ;
@ -93,7 +99,7 @@ void Wizard::MainWizard::setupLog()
void Wizard : : MainWizard : : addLogText ( const QString & text )
{
QString logPath ( QString: : fromUtf8 ( mCfgMgr . getLogPath ( ) . string ( ) . c_str ( ) ) ) ;
QString logPath ( to QString( mCfgMgr . getLogPath ( ) ) ) ;
logPath . append ( QLatin1String ( " wizard.log " ) ) ;
QFile file ( logPath ) ;
@ -121,8 +127,8 @@ void Wizard::MainWizard::addLogText(const QString &text)
void Wizard : : MainWizard : : setupGameSettings ( )
{
QString userPath ( QString: : fromUtf8 ( mCfgMgr . getUserConfigPath ( ) . string ( ) . c_str ( ) ) ) ;
QString globalPath ( QString: : fromUtf8 ( mCfgMgr . getGlobalPath ( ) . string ( ) . c_str ( ) ) ) ;
QString userPath ( to QString( mCfgMgr . getUserConfigPath ( ) ) ) ;
QString globalPath ( to QString( mCfgMgr . getGlobalPath ( ) ) ) ;
QString message ( tr ( " <html><head/><body><p><b>Could not open %1 for reading</b></p> \
< p > Please make sure you have the right permissions \
and try again . < / p > < / body > < / html > " ));
@ -181,7 +187,7 @@ void Wizard::MainWizard::setupGameSettings()
void Wizard : : MainWizard : : setupLauncherSettings ( )
{
QString path ( QString: : fromUtf8 ( mCfgMgr . getUserConfigPath ( ) . string ( ) . c_str ( ) ) ) ;
QString path ( to QString( mCfgMgr . getUserConfigPath ( ) ) ) ;
path . append ( QLatin1String ( Config : : LauncherSettings : : sLauncherConfigFileName ) ) ;
QString message ( tr ( " <html><head/><body><p><b>Could not open %1 for reading</b></p> \
@ -228,7 +234,7 @@ void Wizard::MainWizard::runSettingsImporter()
QString path ( field ( QLatin1String ( " installation.path " ) ) . toString ( ) ) ;
// Create the file if it doesn't already exist, else the importer will fail
QString userPath ( QString: : fromUtf8 ( mCfgMgr . getUserConfigPath ( ) . string ( ) . c_str ( ) ) ) ;
QString userPath ( to QString( mCfgMgr . getUserConfigPath ( ) ) ) ;
QFile file ( userPath + QLatin1String ( " openmw.cfg " ) ) ;
if ( ! file . exists ( ) ) {
@ -387,7 +393,7 @@ void Wizard::MainWizard::writeSettings()
mGameSettings . removeDataDir ( path ) ;
mGameSettings . addDataDir ( path ) ;
QString userPath ( QString: : fromUtf8 ( mCfgMgr . getUserConfigPath ( ) . string ( ) . c_str ( ) ) ) ;
QString userPath ( to QString( mCfgMgr . getUserConfigPath ( ) ) ) ;
QDir dir ( userPath ) ;
if ( ! dir . exists ( ) ) {
@ -460,3 +466,8 @@ bool Wizard::MainWizard::findFiles(const QString &name, const QString &path)
return ( dir . entryList ( ) . contains ( name + QLatin1String ( " .esm " ) , Qt : : CaseInsensitive )
& & dir . entryList ( ) . contains ( name + QLatin1String ( " .bsa " ) , Qt : : CaseInsensitive ) ) ;
}
QString Wizard : : MainWizard : : toQString ( const boost : : filesystem : : path & path )
{
return QString : : fromUtf8 ( path . string ( ) . c_str ( ) ) ;
}