26 #include <installmgr.h>
33 inline bool runMkdir(QDir & dir,
const QString & dirName) {
34 if (!dir.exists(dirName)) {
35 if (!dir.mkpath(dirName)) {
36 qDebug() <<
"failed to make directory" << dirName;
39 qDebug() <<
"made directory" << dirName;
72 QVariant vModuleName = module->property(
"installSourceName");
73 QString moduleName = vModuleName.toString();
84 int status =
m_iMgr.installModule(&lMgr,
86 module->
name().toLatin1(),
91 qWarning() <<
"Error with install: " << status
92 <<
"module:" << module->
name();
96 int status =
m_iMgr.installModule(&lMgr,
97 installSource.directory.c_str(),
98 module->
name().toLatin1());
101 }
else if (status != -1) {
102 qWarning() <<
"Error with install: " << status
103 <<
"module:" << module->
name();
121 std::unique_ptr<CSwordBackend const>
backend;
125 m =
backend->findModuleByName(installedModule->
name());
131 qDebug() <<
"Removing module" << installedModule->
name();
134 auto const moduleName(m->
name());
137 if (dataPath.left(2) == QStringLiteral(
"./"))
138 dataPath = dataPath.mid(2);
140 if (prefixPath.contains(dataPath)) {
141 prefixPath.remove(prefixPath.indexOf(dataPath), dataPath.length());
146 sword::SWMgr mgr(prefixPath.toLatin1());
147 BtInstallMgr().removeModule(&mgr, moduleName.toLatin1());
void downloadStarted(int moduleIndex)
void preparingInstall(int moduleIndex)
void installCompleted(int moduleIndex, bool success)
std::atomic< bool > m_stopRequested
void slotDownloadStarted()
void statusUpdated(int moduleIndex, int progressPercent)
void slotManagerStatusUpdated(int totalProgress, int fileProgress)
const QString m_destination
const QList< CSwordModuleInfo * > & m_modules
CSwordModuleInfo * findModuleByName(const QString &name) const
Searches for a module with the given name.
QString prefixPath() const
static CSwordBackend & instance() noexcept
QString config(const CSwordModuleInfo::ConfigEntry entry) const
QString const & name() const
bool isRemote(const sword::InstallSource &source)
sword::InstallSource source(const QString &name)
std::unique_ptr< CSwordBackend > backend(sword::InstallSource const &is)
bool runMkdir(QDir &dir, const QString &dirName)