@ -508,7 +508,7 @@ the module remote installation feature!</b>")
success = true ;
success = true ;
}
}
else { //an error occurres, the KIO library should display an error message
else { //an error occurres, the KIO library should display an error message
qWarning( " InstallMgr: refreshRemoteSources returned an error. " ) ;
t qWarning( " InstallMgr: refreshRemoteSources returned an error. " ) ;
m_refreshedRemoteSources = false ;
m_refreshedRemoteSources = false ;
success = false ;
success = false ;
}
}
@ -540,17 +540,17 @@ the module remote installation feature!</b>")
if ( BTInstallMgr : : Tool : : RemoteConfig : : isRemoteSource ( & is )
if ( BTInstallMgr : : Tool : : RemoteConfig : : isRemoteSource ( & is )
& & ! refreshRemoteModuleCache ( sourceName ) ) {
& & ! refreshRemoteModuleCache ( sourceName ) ) {
// qWarning("finish");
// t qWarning("finish");
m_installModuleListView - > finish ( ) ;
m_installModuleListView - > finish ( ) ;
return false ;
return false ;
}
}
//kind of a hack to provide a pointer to mgr next line
//kind of a hack to provide a pointer to mgr next line
// qWarning("createing remote_backend");
// t qWarning("createing remote_backend");
util : : scoped_ptr < CSwordBackend > remote_backend ( BTInstallMgr : : Tool : : backend ( & is ) ) ;
util : : scoped_ptr < CSwordBackend > remote_backend ( BTInstallMgr : : Tool : : backend ( & is ) ) ;
// qWarning("config path1 is %s", remote_backend->configPath);
// t qWarning("config path1 is %s", remote_backend->configPath);
// qWarning("config path2 is %s", BTInstallMgr::Tool::backend(&is)->configPath ); //mem leak
// t qWarning("config path2 is %s", BTInstallMgr::Tool::backend(&is)->configPath ); //mem leak
// qWarning("after creating remote_backend");
// t qWarning("after creating remote_backend");
Q_ASSERT ( remote_backend ) ;
Q_ASSERT ( remote_backend ) ;
Q_ASSERT ( BTInstallMgr : : Tool : : RemoteConfig : : isRemoteSource ( & is ) ) ;
Q_ASSERT ( BTInstallMgr : : Tool : : RemoteConfig : : isRemoteSource ( & is ) ) ;
if ( ! remote_backend ) {
if ( ! remote_backend ) {
@ -560,22 +560,22 @@ the module remote installation feature!</b>")
CSwordBackend * local_backend = CPointers : : backend ( ) ;
CSwordBackend * local_backend = CPointers : : backend ( ) ;
Q_ASSERT ( local_backend ) ;
Q_ASSERT ( local_backend ) ;
// qWarning("local backend has path %s", local_backend->);
// t qWarning("local backend has path %s", local_backend->);
KApplication : : kApplication ( ) - > processEvents ( ) ;
KApplication : : kApplication ( ) - > processEvents ( ) ;
//local_backend.initModules();
//local_backend.initModules();
// qWarning("config path3 is %s", remote_backend->configPath);
// t qWarning("config path3 is %s", remote_backend->configPath);
ListCSwordModuleInfo mods = remote_backend - > moduleList ( ) ;
ListCSwordModuleInfo mods = remote_backend - > moduleList ( ) ;
Q_ASSERT ( mods . count ( ) > 0 ) ;
Q_ASSERT ( mods . count ( ) > 0 ) ;
ListCSwordModuleInfo : : iterator end_it = mods . end ( ) ;
ListCSwordModuleInfo : : iterator end_it = mods . end ( ) ;
for ( ListCSwordModuleInfo : : iterator it ( mods . begin ( ) ) ; it ! = end_it ; + + it ) {
for ( ListCSwordModuleInfo : : iterator it ( mods . begin ( ) ) ; it ! = end_it ; + + it ) {
// qWarning("adding module %s (%s)", (*it)->name().latin1(), (*it)->config(CSwordModuleInfo::AbsoluteDataPath).latin1());
// t qWarning("adding module %s (%s)", (*it)->name().latin1(), (*it)->config(CSwordModuleInfo::AbsoluteDataPath).latin1());
bool isUpdate = false ;
bool isUpdate = false ;
CSwordModuleInfo * const installedModule = local_backend - > findModuleByName ( ( * it ) - > name ( ) ) ;
CSwordModuleInfo * const installedModule = local_backend - > findModuleByName ( ( * it ) - > name ( ) ) ;
if ( installedModule ) {
if ( installedModule ) {
// qWarning("module is already installed in %s", installedModule->config(CSwordModuleInfo::AbsoluteDataPath).latin1());
// t qWarning("module is already installed in %s", installedModule->config(CSwordModuleInfo::AbsoluteDataPath).latin1());
}
}
// Q_ASSERT(installedModule);
// Q_ASSERT(installedModule);
@ -591,7 +591,7 @@ the module remote installation feature!</b>")
isUpdate = ( newVersion > installedVersion ) ;
isUpdate = ( newVersion > installedVersion ) ;
if ( ! isUpdate ) {
if ( ! isUpdate ) {
// qWarning(" mod %s is not an update", (*it)->name().latin1());
// t qWarning(" mod %s is not an update", (*it)->name().latin1());
continue ;
continue ;
}
}
}
}
@ -684,7 +684,7 @@ the module remote installation feature!</b>")
}
}
void CSwordSetupDialog : : slot_installModules ( ) {
void CSwordSetupDialog : : slot_installModules ( ) {
qWarning( " CSwordSetupDialog::slot_installModules() " ) ;
t qWarning( " CSwordSetupDialog::slot_installModules() " ) ;
// m_installContinueButton->setEnabled(false);
// m_installContinueButton->setEnabled(false);
// m_installBackButton->setEnabled(false);
// m_installBackButton->setEnabled(false);
@ -703,7 +703,7 @@ the module remote installation feature!</b>")
m_currentInstallMgr = & iMgr ;
m_currentInstallMgr = & iMgr ;
sword : : InstallSource is = BTInstallMgr : : Tool : : RemoteConfig : : source ( & iMgr , currentInstallSource ( ) ) ;
sword : : InstallSource is = BTInstallMgr : : Tool : : RemoteConfig : : source ( & iMgr , currentInstallSource ( ) ) ;
qWarning( " installing from %s/%s " , is . source . c_str ( ) , is . directory . c_str ( ) ) ;
t qWarning( " installing from %s/%s " , is . source . c_str ( ) , is . directory . c_str ( ) ) ;
TQString target = m_targetCombo - > currentText ( ) ;
TQString target = m_targetCombo - > currentText ( ) ;
//make sure target/mods.d and target/modules exist
//make sure target/mods.d and target/modules exist
@ -740,7 +740,7 @@ the module remote installation feature!</b>")
for ( TQStringList : : Iterator it = moduleList . begin ( ) ; ( it ! = moduleList . end ( ) ) & & ! m_progressDialog - > wasCancelled ( ) ; + + it , + + m_installedModuleCount ) {
for ( TQStringList : : Iterator it = moduleList . begin ( ) ; ( it ! = moduleList . end ( ) ) & & ! m_progressDialog - > wasCancelled ( ) ; + + it , + + m_installedModuleCount ) {
qWarning( " installing %s " , ( * it ) . latin1 ( ) ) ;
t qWarning( " installing %s " , ( * it ) . latin1 ( ) ) ;
m_installingModule = * it ;
m_installingModule = * it ;
//check whether it's an update. If yes, remove existing module first
//check whether it's an update. If yes, remove existing module first
@ -767,9 +767,9 @@ the module remote installation feature!</b>")
if ( ! m_progressDialog - > wasCancelled ( )
if ( ! m_progressDialog - > wasCancelled ( )
& & BTInstallMgr : : Tool : : RemoteConfig : : isRemoteSource ( & is ) ) {
& & BTInstallMgr : : Tool : : RemoteConfig : : isRemoteSource ( & is ) ) {
// qWarning("calling install");
// t qWarning("calling install");
int status = iMgr . installModule ( & lMgr , 0 , ( * it ) . latin1 ( ) , & is ) ;
int status = iMgr . installModule ( & lMgr , 0 , ( * it ) . latin1 ( ) , & is ) ;
// qWarning("status: %d", status);
// t qWarning("status: %d", status);
Q_ASSERT ( status ! = - 1 ) ;
Q_ASSERT ( status ! = - 1 ) ;
}
}
else if ( ! m_progressDialog - > wasCancelled ( ) ) { //local source
else if ( ! m_progressDialog - > wasCancelled ( ) ) { //local source