summaryrefslogtreecommitdiff
path: root/plugins/PluginLoader
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2018-02-23 23:49:48 +0000
committerThomas Preud'homme <robotux@celest.fr>2018-02-23 23:49:48 +0000
commitbd56579c7d9de94c17287adefa118290e6b7ba33 (patch)
tree666d7d0b6945b442573b7a3145969f66a53aa460 /plugins/PluginLoader
parentb3c8bdcc0d1e4b2ab298847a7902b6d60410a5bc (diff)
New upstream version 1.4.0.3
Diffstat (limited to 'plugins/PluginLoader')
-rw-r--r--plugins/PluginLoader/catchcopy-v0002/documentation.dox3
-rw-r--r--plugins/PluginLoader/catchcopy-v0002/informations.xml2
-rw-r--r--plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp108
-rw-r--r--plugins/PluginLoader/catchcopy-v0002/pluginLoader.h13
-rw-r--r--plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro67
5 files changed, 102 insertions, 91 deletions
diff --git a/plugins/PluginLoader/catchcopy-v0002/documentation.dox b/plugins/PluginLoader/catchcopy-v0002/documentation.dox
index 08ccc4a..b9c9d13 100644
--- a/plugins/PluginLoader/catchcopy-v0002/documentation.dox
+++ b/plugins/PluginLoader/catchcopy-v0002/documentation.dox
@@ -20,7 +20,7 @@
\section mainpage_downloads Downloads
- You can found link on <a href="http://ultracopier.first-world.info/">Ultracopier (Supercopier/Teracopy)</a> project page, via git, snapshot sources, ...
+ You can find the link on <a href="http://ultracopier.first-world.info/">Ultracopier</a> project page, via git, snapshot sources, ...
\section mainpage_algorithm Requirements
@@ -31,4 +31,3 @@
The code source is under GPL3.
*/
-
diff --git a/plugins/PluginLoader/catchcopy-v0002/informations.xml b/plugins/PluginLoader/catchcopy-v0002/informations.xml
index 0b62f30..9257d3a 100644
--- a/plugins/PluginLoader/catchcopy-v0002/informations.xml
+++ b/plugins/PluginLoader/catchcopy-v0002/informations.xml
@@ -17,7 +17,7 @@
<description xml:lang="en"><![CDATA[Plugin loader for catchcopy v0002. Allow to receive copy list from plugin/explorer compatible with catchcopy.]]></description>
<description xml:lang="fr"><![CDATA[Chargeur de plugin pour catchcopy v0002. Permet de recevoir un liste de copie venant d'un plugin/explorateur avec catchcopy.]]></description>
<!-- Version of this release of this plugin, need be like that's: A.B.C.D, where A, B, C and D is number -->
- <version>1.2.3.6</version>
+ <version>1.4.0.3</version>
<!-- This internal name should never change, because it is used to detect when a particular plugin is updated. It must comprise only lower case ASCII characters (a-z), numerical digits (0-9), "-", "." or "_", and it must be be unique within the category. And have size lower than 64 char. -->
<name>catchcopy-v0002</name>
<!-- Dependency checking. This is used to check when a plugin may not be compatible with an updated version of either Ultracopier or another plugin. This example only checks Ultracopier. -->
diff --git a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp
index 2009e0a..363f372 100644
--- a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp
+++ b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp
@@ -4,6 +4,7 @@
#include "pluginLoader.h"
#include "PlatformMacro.h"
+#include "../../../cpp11addition.h"
#include <QFile>
#include <QDir>
@@ -74,7 +75,7 @@ void WindowsExplorerLoader::setEnabled(const bool &needBeRegistred)
}
if(this->needBeRegistred==needBeRegistred)
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Double event dropped: %1").arg(needBeRegistred));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Double event dropped: %1").arg(needBeRegistred).toStdString());
if(needBeRegistred)
emit newState(Ultracopier::Caught);
else
@@ -82,14 +83,14 @@ void WindowsExplorerLoader::setEnabled(const bool &needBeRegistred)
return;
}
this->needBeRegistred=needBeRegistred;
- int index=0;
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, needBeRegistred: %1, allDllIsImportant: %2").arg(needBeRegistred).arg(allDllIsImportant));
+ unsigned int index=0;
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, needBeRegistred: %1, allDllIsImportant: %2").arg(needBeRegistred).arg(allDllIsImportant).toStdString());
bool oneHaveFound=false;
index=0;
while(index<importantDll.size())
{
- if(QFile::exists(pluginPath+importantDll.at(index)))
+ if(QFile::exists(QString::fromStdString(pluginPath+importantDll.at(index))))
{
oneHaveFound=true;
break;
@@ -101,7 +102,7 @@ void WindowsExplorerLoader::setEnabled(const bool &needBeRegistred)
index=0;
while(index<secondDll.size())
{
- if(QFile::exists(pluginPath+secondDll.at(index)))
+ if(QFile::exists(QString::fromStdString(pluginPath+secondDll.at(index))))
{
oneHaveFound=true;
break;
@@ -111,7 +112,7 @@ void WindowsExplorerLoader::setEnabled(const bool &needBeRegistred)
}
if(!oneHaveFound)
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("No dll have found"));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"No dll have found");
emit newState(Ultracopier::Uncaught);
if(!needBeRegistred)
correctlyLoaded.clear();
@@ -128,7 +129,7 @@ void WindowsExplorerLoader::setEnabled(const bool &needBeRegistred)
!(
(needBeRegistred)
||
- (!needBeRegistred && correctlyLoaded.contains(importantDll.at(index)))
+ (!needBeRegistred && correctlyLoaded.find(importantDll.at(index))!=correctlyLoaded.cend())
)
))
{
@@ -155,7 +156,7 @@ void WindowsExplorerLoader::setEnabled(const bool &needBeRegistred)
!(
(needBeRegistred && allDllIsImportant)
||
- (!needBeRegistred && correctlyLoaded.contains(secondDll.at(index)))
+ (!needBeRegistred && correctlyLoaded.find(secondDll.at(index))!=correctlyLoaded.cend())
)
))
{
@@ -234,25 +235,29 @@ bool WindowsExplorerLoader::checkExistsDll()
if(is64Bits)
{
ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"64Bits is important");
- importantDll << CATCHCOPY_DLL_64;
- secondDll << CATCHCOPY_DLL_32;
+ importantDll.push_back(CATCHCOPY_DLL_64);
+ secondDll.push_back(CATCHCOPY_DLL_32);
}
else
{
ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"32Bits is important");
- importantDll << CATCHCOPY_DLL_32;
- secondDll << CATCHCOPY_DLL_64;
+ importantDll.push_back(CATCHCOPY_DLL_32);
+ secondDll.push_back(CATCHCOPY_DLL_64);
}
- int index=0;
+ unsigned int index=0;
while(index<importantDll.size())
{
- if(!QFile::exists(pluginPath+importantDll.at(index)+NORMAL_EXT))
+ if(!QFile::exists(QString::fromStdString(pluginPath+importantDll.at(index)+NORMAL_EXT)))
{
- if(!QFile::exists(pluginPath+importantDll.at(index)+SECOND_EXT))
+ if(!QFile::exists(QString::fromStdString(pluginPath+importantDll.at(index)+SECOND_EXT)))
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("file not found, drop to the list: %1 and %2").arg(pluginPath+importantDll.at(index)+NORMAL_EXT).arg(pluginPath+importantDll.at(index)+SECOND_EXT));
- importantDll.removeAt(index);
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"file not found, drop to the list: "+
+ pluginPath+importantDll.at(index)+NORMAL_EXT+
+ " and "+
+ pluginPath+importantDll.at(index)+SECOND_EXT
+ );
+ importantDll.erase(importantDll.cbegin()+index);
index--;
}
else
@@ -265,12 +270,15 @@ bool WindowsExplorerLoader::checkExistsDll()
index=0;
while(index<secondDll.size())
{
- if(!QFile::exists(pluginPath+secondDll.at(index)+NORMAL_EXT))
+ if(!QFile::exists(QString::fromStdString(pluginPath+secondDll.at(index)+NORMAL_EXT)))
{
- if(!QFile::exists(pluginPath+secondDll.at(index)+SECOND_EXT))
+ if(!QFile::exists(QString::fromStdString(pluginPath+secondDll.at(index)+SECOND_EXT)))
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("file not found, drop to the list: %1 and %2").arg(pluginPath+secondDll.at(index)+NORMAL_EXT).arg(pluginPath+secondDll.at(index)+SECOND_EXT));
- secondDll.removeAt(index);
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,
+ "file not found, drop to the list: "+pluginPath+secondDll.at(index)+NORMAL_EXT+
+ " and "+pluginPath+secondDll.at(index)+SECOND_EXT
+ );
+ secondDll.erase(secondDll.cbegin()+index);
index--;
}
else
@@ -286,49 +294,49 @@ bool WindowsExplorerLoader::checkExistsDll()
return false;
}
-void WindowsExplorerLoader::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion)
+void WindowsExplorerLoader::setResources(OptionInterface * options, const std::string &writePath, const std::string &pluginPath, const bool &portableVersion)
{
Q_UNUSED(options);
Q_UNUSED(writePath);
Q_UNUSED(pluginPath);
Q_UNUSED(portableVersion);
#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE
- this->pluginPath=QCoreApplication::applicationDirPath()+"/";
+ this->pluginPath=QCoreApplication::applicationDirPath().toStdString()+"/";
#else
this->pluginPath=pluginPath;
#endif
this->optionsEngine=options;
if(optionsEngine!=NULL)
{
- QList<QPair<QString, QVariant> > KeysList;
- KeysList.append(qMakePair(QStringLiteral("allDllIsImportant"),QVariant(false)));
- KeysList.append(qMakePair(QStringLiteral("Debug"),QVariant(false)));
+ std::vector<std::pair<std::string, std::string> > KeysList;
+ KeysList.push_back(std::pair<std::string, std::string>("allDllIsImportant","false"));
+ KeysList.push_back(std::pair<std::string, std::string>("Debug","false"));
optionsEngine->addOptionGroup(KeysList);
- allDllIsImportant=optionsEngine->getOptionValue("allDllIsImportant").toBool();
- Debug=optionsEngine->getOptionValue("Debug").toBool();
+ allDllIsImportant=stringtobool(optionsEngine->getOptionValue("allDllIsImportant"));
+ Debug=stringtobool(optionsEngine->getOptionValue("Debug"));
optionsWidget->setAllDllIsImportant(allDllIsImportant);
optionsWidget->setDebug(Debug);
}
}
-bool WindowsExplorerLoader::RegisterShellExtDll(const QString &dllPath, const bool &bRegister,const bool &quiet)
+bool WindowsExplorerLoader::RegisterShellExtDll(const std::string &dllPath, const bool &bRegister, const bool &quiet)
{
if(Debug)
{
- QString message;
+ std::string message;
if(bRegister)
- message+=QStringLiteral("Try load the dll: %1, and ").arg(dllPath);
+ message+="Try load the dll: %1, and "+dllPath;
else
- message+=QStringLiteral("Try unload the dll: %1, and ").arg(dllPath);
+ message+="Try unload the dll: %1, and "+dllPath;
if(quiet)
- message+=QStringLiteral("don't open the UAC");
+ message+="don't open the UAC";
else
- message+=QStringLiteral("open the UAC if needed");
- QMessageBox::information(NULL,"Debug",message);
+ message+="open the UAC if needed";
+ QMessageBox::information(NULL,"Debug",QString::fromStdString(message));
}
- if(bRegister && correctlyLoaded.contains(dllPath))
+ if(bRegister && correctlyLoaded.find(dllPath)!=correctlyLoaded.cend())
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Try dual load: %1").arg(dllPath));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Try dual load: "+dllPath);
return false;
}
////////////////////////////// First way to load //////////////////////////////
@@ -337,8 +345,8 @@ bool WindowsExplorerLoader::RegisterShellExtDll(const QString &dllPath, const bo
arguments.append("/s");
if(!bRegister)
arguments.append("/u");
- arguments.append(dllPath);
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: regsvr32 "+arguments.join(" "));
+ arguments.append(QString::fromStdString(dllPath));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: regsvr32 "+arguments.join(" ").toStdString());
int result;
#ifdef Q_OS_WIN32
QProcess process;
@@ -353,9 +361,9 @@ bool WindowsExplorerLoader::RegisterShellExtDll(const QString &dllPath, const bo
QString out=QString::fromLocal8Bit(process.readAllStandardOutput());
QString outError=QString::fromLocal8Bit(process.readAllStandardError());
if(!out.isEmpty())
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"regsvr32 output: "+out);
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"regsvr32 output: "+out.toStdString());
if(!outError.isEmpty())
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"regsvr32 error output: "+outError);
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"regsvr32 error output: "+outError.toStdString());
}
#else
result=0;
@@ -364,14 +372,14 @@ bool WindowsExplorerLoader::RegisterShellExtDll(const QString &dllPath, const bo
if(result==0)
{
if(bRegister)
- correctlyLoaded << dllPath;
+ correctlyLoaded.insert(dllPath);
ok=true;
}
#if ! defined(_M_X64)
if(result==999 && !changeOfArchDetected)//code of wrong arch for the dll
{
changeOfArchDetected=true;
- QStringList temp;
+ std::vector<std::string> temp;
temp = importantDll;
secondDll = importantDll;
importantDll = temp;
@@ -380,7 +388,7 @@ bool WindowsExplorerLoader::RegisterShellExtDll(const QString &dllPath, const bo
#endif
if(result==5)
{
- if(!quiet || (!bRegister && correctlyLoaded.contains(dllPath)))
+ if(!quiet || (!bRegister && correctlyLoaded.find(dllPath)!=correctlyLoaded.cend()))
{
arguments.last()=QStringLiteral("\"%1\"").arg(arguments.last());
////////////////////////////// Last way to load //////////////////////////////
@@ -398,7 +406,7 @@ bool WindowsExplorerLoader::RegisterShellExtDll(const QString &dllPath, const bo
sei.fMask = SEE_MASK_UNICODE;
sei.lpVerb = TEXT("runas");
sei.lpFile = TEXT("regsvr32.exe");
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"in win32 mode: arrayArg: "+QString::fromWCharArray(arrayArg,size_lenght));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"in win32 mode: arrayArg: "+QString::fromWCharArray(arrayArg,size_lenght).toStdString());
sei.lpParameters = arrayArg;
sei.nShow = SW_SHOW;
ok=ShellExecuteEx(&sei);
@@ -406,15 +414,15 @@ bool WindowsExplorerLoader::RegisterShellExtDll(const QString &dllPath, const bo
ok=true;
#endif
if(ok && bRegister)
- correctlyLoaded << dllPath;
+ correctlyLoaded.insert(dllPath);
}
else
ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"not try because need be quiet: "+dllPath);
}
else
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("regsvr32 terminated with: %1").arg(result));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"regsvr32 terminated with: "+std::to_string(result));
if(!bRegister)
- correctlyLoaded.remove(dllPath);
+ correctlyLoaded.erase(dllPath);
return ok;
}
@@ -432,11 +440,11 @@ void WindowsExplorerLoader::newLanguageLoaded()
void WindowsExplorerLoader::setAllDllIsImportant(bool allDllIsImportant)
{
this->allDllIsImportant=allDllIsImportant;
- optionsEngine->setOptionValue("allDllIsImportant",allDllIsImportant);
+ optionsEngine->setOptionValue("allDllIsImportant",std::to_string(allDllIsImportant));
}
void WindowsExplorerLoader::setDebug(bool Debug)
{
this->Debug=Debug;
- optionsEngine->setOptionValue("Debug",Debug);
+ optionsEngine->setOptionValue("Debug",std::to_string(Debug));
}
diff --git a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h
index 0246cd1..d18248d 100644
--- a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h
+++ b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h
@@ -8,6 +8,7 @@
#include <QObject>
#include <QMessageBox>
+#include <unordered_set>
#include <QString>
#include <QStringList>
@@ -29,7 +30,7 @@
class WindowsExplorerLoader : public PluginInterface_PluginLoader
{
Q_OBJECT
- Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.PluginLoader/1.0.0.0" FILE "plugin.json")
+ Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.PluginLoader/1.2.4.0" FILE "plugin.json")
Q_INTERFACES(PluginInterface_PluginLoader)
public:
WindowsExplorerLoader();
@@ -37,17 +38,17 @@ public:
/// \brief try enable/disable the catching
void setEnabled(const bool &needBeRegistred);
/// \brief to set resources, writePath can be empty if read only mode
- void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion);
+ void setResources(OptionInterface * options,const std::string &writePath,const std::string &pluginPath,const bool &portableVersion);
/// \brief to get the options widget, NULL if not have
QWidget * options();
public slots:
/// \brief to reload the translation, because the new language have been loaded
void newLanguageLoaded();
private:
- QString pluginPath;
- QStringList importantDll,secondDll;
- QSet<QString> correctlyLoaded;
- bool RegisterShellExtDll(const QString &dllPath, const bool &bRegister,const bool &quiet);
+ std::string pluginPath;
+ std::vector<std::string> importantDll,secondDll;
+ std::unordered_set<std::string> correctlyLoaded;
+ bool RegisterShellExtDll(const std::string &dllPath, const bool &bRegister,const bool &quiet);
bool checkExistsDll();
bool dllChecked;
bool needBeRegistred;
diff --git a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro
index 0d11721..40d5e5e 100644
--- a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro
+++ b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro
@@ -6,45 +6,48 @@ QT += widgets
TEMPLATE = lib
CONFIG += plugin
HEADERS = \
- StructEnumDefinition.h \
- pluginLoader.h \
- DebugEngineMacro.h \
- Environment.h \
- Variable.h \
- PlatformMacro.h \
- ../../../interface/PluginInterface_PluginLoader.h \
- OptionsWidget.h
+ $$PWD/StructEnumDefinition.h \
+ $$PWD/pluginLoader.h \
+ $$PWD/DebugEngineMacro.h \
+ $$PWD/Environment.h \
+ $$PWD/Variable.h \
+ $$PWD/PlatformMacro.h \
+ $$PWD/../../../interface/PluginInterface_PluginLoader.h \
+ $$PWD/../../../cpp11addition.h \
+ $$PWD/OptionsWidget.h
SOURCES = \
- pluginLoader.cpp \
- OptionsWidget.cpp
+ $$PWD/pluginLoader.cpp \
+ $$PWD/OptionsWidget.cpp \
+ $$PWD/../../../cpp11addition.cpp \
+ $$PWD/../../../cpp11additionstringtointcpp.cpp
TARGET = $$qtLibraryTarget(pluginLoader)
-TRANSLATIONS += Languages/ar/translation.ts \
- Languages/de/translation.ts \
- Languages/el/translation.ts \
- Languages/en/translation.ts \
- Languages/es/translation.ts \
- Languages/fr/translation.ts \
- Languages/hi/translation.ts \
- Languages/hu/translation.ts \
- Languages/id/translation.ts \
- Languages/it/translation.ts \
- Languages/ja/translation.ts \
- Languages/ko/translation.ts \
- Languages/nl/translation.ts \
- Languages/no/translation.ts \
- Languages/pl/translation.ts \
- Languages/pt/translation.ts \
- Languages/ru/translation.ts \
- Languages/th/translation.ts \
- Languages/tr/translation.ts \
- Languages/zh/translation.ts
+TRANSLATIONS += \
+ $$PWD/Languages/ar/translation.ts \
+ $$PWD/Languages/de/translation.ts \
+ $$PWD/Languages/el/translation.ts \
+ $$PWD/Languages/en/translation.ts \
+ $$PWD/Languages/es/translation.ts \
+ $$PWD/Languages/fr/translation.ts \
+ $$PWD/Languages/hi/translation.ts \
+ $$PWD/Languages/hu/translation.ts \
+ $$PWD/Languages/id/translation.ts \
+ $$PWD/Languages/it/translation.ts \
+ $$PWD/Languages/ja/translation.ts \
+ $$PWD/Languages/ko/translation.ts \
+ $$PWD/Languages/nl/translation.ts \
+ $$PWD/Languages/no/translation.ts \
+ $$PWD/Languages/pl/translation.ts \
+ $$PWD/Languages/pt/translation.ts \
+ $$PWD/Languages/ru/translation.ts \
+ $$PWD/Languages/th/translation.ts \
+ $$PWD/Languages/tr/translation.ts \
+ $$PWD/Languages/zh/translation.ts
win32:LIBS += -lole32 -lshell32
FORMS += \
- OptionsWidget.ui
+ $$PWD/OptionsWidget.ui
CONFIG(static, static|shared) {
DEFINES += ULTRACOPIER_PLUGIN_ALL_IN_ONE
}
-