diff options
Diffstat (limited to 'plugins/SessionLoader')
19 files changed, 352 insertions, 137 deletions
diff --git a/plugins/SessionLoader/KDE4/DebugEngineMacro.h b/plugins/SessionLoader/KDE4/DebugEngineMacro.h index a3dd648..4582010 100644 --- a/plugins/SessionLoader/KDE4/DebugEngineMacro.h +++ b/plugins/SessionLoader/KDE4/DebugEngineMacro.h @@ -1,12 +1,15 @@ /** \file DebugEngineMacro.h \brief Define the macro for the debug \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef DEBUGENGINEMACRO_H #define DEBUGENGINEMACRO_H +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + /// \brief Macro for the debug log #ifdef ULTRACOPIER_PLUGIN_DEBUG #if defined (__FILE__) && defined (__LINE__) diff --git a/plugins/SessionLoader/KDE4/Environment.h b/plugins/SessionLoader/KDE4/Environment.h index 94fd104..265a5a6 100644 --- a/plugins/SessionLoader/KDE4/Environment.h +++ b/plugins/SessionLoader/KDE4/Environment.h @@ -1,8 +1,7 @@ /** \file Environment.h
\brief Define the environment variable and global function
\author alpha_one_x86
-\version 0.3
-\date 2010 */
+\licence GPL3, see the file COPYING */
#include "Variable.h"
/// \brief The global include
diff --git a/plugins/SessionLoader/KDE4/Variable.h b/plugins/SessionLoader/KDE4/Variable.h index 8179c93..963d0c8 100644 --- a/plugins/SessionLoader/KDE4/Variable.h +++ b/plugins/SessionLoader/KDE4/Variable.h @@ -1,8 +1,7 @@ /** \file Variable.h
\brief Define the environment variable
\author alpha_one_x86
-\version 0.3
-\date 2010 */
+\licence GPL3, see the file COPYING */
#ifndef VARIABLE_H
#define VARIABLE_H
diff --git a/plugins/SessionLoader/KDE4/documentation.dox b/plugins/SessionLoader/KDE4/documentation.dox index fbf0eb4..98ed23f 100755..100644 --- a/plugins/SessionLoader/KDE4/documentation.dox +++ b/plugins/SessionLoader/KDE4/documentation.dox @@ -11,12 +11,12 @@ \section mainpage_overview Overview It control if it loaded with the session.\n - More informations on <a href="http://ultracopier-wiki.first-world.info/">the wiki of ultracopier</a>. Is part of Ultracopier 0.3 project. + More informations on <a href="http://ultracopier-wiki.first-world.info/">the wiki of ultracopier</a>. \section mainpage_platforms Platforms - This plugin might be usable in all environments where you find Qt 4.\n - To be compatible with the official Ultracopier plugins, you need compil it with Gcc, Qt4.8, and same env as Ultracopier have been compiled, see the documentation. + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. \section mainpage_downloads Downloads diff --git a/plugins/SessionLoader/KDE4/informations.xml b/plugins/SessionLoader/KDE4/informations.xml index cdc5150..2178b0e 100644 --- a/plugins/SessionLoader/KDE4/informations.xml +++ b/plugins/SessionLoader/KDE4/informations.xml @@ -17,11 +17,10 @@ <description xml:lang="en"><![CDATA[Test plugin to show how create SessionLoader plugin]]></description> <description xml:lang="fr"><![CDATA[Plugin de test pour monter comment créer un plugin SessionLoader]]></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>0.3.1.0</version> + <version>1.2.3.6</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>KDE4</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. --> <dependencies><![CDATA[ - >=ultracopier-0.3.1.0 ]]></dependencies> </package>
\ No newline at end of file diff --git a/plugins/SessionLoader/KDE4/plugin.json b/plugins/SessionLoader/KDE4/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/SessionLoader/KDE4/plugin.json @@ -0,0 +1 @@ +{}
\ No newline at end of file diff --git a/plugins/SessionLoader/KDE4/sessionLoader.cpp b/plugins/SessionLoader/KDE4/sessionLoader.cpp index 28bdc59..8024264 100644 --- a/plugins/SessionLoader/KDE4/sessionLoader.cpp +++ b/plugins/SessionLoader/KDE4/sessionLoader.cpp @@ -1,62 +1,58 @@ /** \file session-loader.cpp \brief Define the session plugin loader test \author alpha_one_x86 -\version 0.3 -\date 2010 */ +*/ -#include <QtCore> #include <QFile> #include <QDir> +#include <QCoreApplication> #include "sessionLoader.h" -void SessionLoader::setEnabled(bool newValue) +void KDESessionLoader::setEnabled(const bool &enabled) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, newValue: "+QString::number(newValue)); - QFile link(QDir::homePath()+"/.kde4/Autostart/ultracopier.sh"); - if(!newValue) - { - if(link.exists() && !link.remove()) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to remove from the startup: "+link.errorString()); - } - else - { - if(link.open(QIODevice::WriteOnly)) - { - link.write(QString("#!/bin/bash\n").toLocal8Bit()); - link.write(QString(QCoreApplication::applicationFilePath()).toLocal8Bit()); - link.close(); - if(!link.setPermissions(QFile::ExeOwner|QFile::WriteOwner|QFile::ReadOwner)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to set permissions: "+link.errorString()); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to open in writing the file: "+link.errorString()); - } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, enabled: "+QString::number(enabled)); + QFile link(QDir::homePath()+"/.kde4/Autostart/ultracopier.sh"); + if(!enabled) + { + if(link.exists() && !link.remove()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to remove from the startup: "+link.errorString()); + } + else + { + if(link.open(QIODevice::WriteOnly)) + { + link.write(QStringLiteral("#!/bin/bash\n").toLocal8Bit()); + link.write(QString(QCoreApplication::applicationFilePath()).toLocal8Bit()); + link.close(); + if(!link.setPermissions(QFile::ExeOwner|QFile::WriteOwner|QFile::ReadOwner)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to set permissions: "+link.errorString()); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to open in writing the file: "+link.errorString()); + } } -bool SessionLoader::getEnabled() +bool KDESessionLoader::getEnabled() const { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, return this value: "+QString::number(QFile::exists(QDir::homePath()+"/.kde4/Autostart/ultracopier.sh"))); - //return the value into the variable - return QFile::exists(QDir::homePath()+"/.kde4/Autostart/ultracopier.sh"); + //return the value into the variable + return QFile::exists(QDir::homePath()+"/.kde4/Autostart/ultracopier.sh"); } -void SessionLoader::setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion) +void KDESessionLoader::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion) { - Q_UNUSED(options); - Q_UNUSED(writePath); - Q_UNUSED(pluginPath); - Q_UNUSED(portableVersion); + Q_UNUSED(options); + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + Q_UNUSED(portableVersion); } /// \brief to get the options widget, NULL if not have -QWidget * SessionLoader::options() +QWidget * KDESessionLoader::options() { - return NULL; + return NULL; } /// \brief to reload the translation, because the new language have been loaded -void SessionLoader::newLanguageLoaded() +void KDESessionLoader::newLanguageLoaded() { } - -Q_EXPORT_PLUGIN2(sessionLoader, SessionLoader); diff --git a/plugins/SessionLoader/KDE4/sessionLoader.h b/plugins/SessionLoader/KDE4/sessionLoader.h index 41c4204..b037da7 100644 --- a/plugins/SessionLoader/KDE4/sessionLoader.h +++ b/plugins/SessionLoader/KDE4/sessionLoader.h @@ -1,8 +1,7 @@ /** \file sessionLoader.h \brief Define the session loader \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef SESSION_LOADER_PLUGIN_H #define SESSION_LOADER_PLUGIN_H @@ -12,27 +11,23 @@ #include "../../../interface/PluginInterface_SessionLoader.h" /// \brief Define the session loader -class SessionLoader : public PluginInterface_SessionLoader +class KDESessionLoader : public PluginInterface_SessionLoader { - Q_OBJECT - Q_INTERFACES(PluginInterface_SessionLoader) + Q_OBJECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.SessionLoader/1.0.0.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_SessionLoader) public: - /// \brief to set if it's enabled or not - void setEnabled(bool); - /// \brief to get if is enabled - bool getEnabled(); - /// \brief set the resources for the plugins - void setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion); - /// \brief to get the options widget, NULL if not have - QWidget * options(); + /// \brief to set if it's enabled or not + void setEnabled(const bool &enabled); + /// \brief to get if is enabled + bool getEnabled() const; + /// \brief set the resources for the plugins + void setResources(OptionInterface * options,const QString &writePath,const QString &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(); -signals: - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif + /// \brief to reload the translation, because the new language have been loaded + void newLanguageLoaded(); }; #endif // SESSION_LOADER_PLUGIN_H diff --git a/plugins/SessionLoader/KDE4/sessionLoader.pro b/plugins/SessionLoader/KDE4/sessionLoader.pro index e036663..4398dfe 100644 --- a/plugins/SessionLoader/KDE4/sessionLoader.pro +++ b/plugins/SessionLoader/KDE4/sessionLoader.pro @@ -1,3 +1,7 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + TEMPLATE = lib CONFIG += plugin HEADERS = sessionLoader.h \ diff --git a/plugins/SessionLoader/KDE4/sessionLoader.pro.user.2.7pre1 b/plugins/SessionLoader/KDE4/sessionLoader.pro.user.2.7pre1 new file mode 100644 index 0000000..7741b0d --- /dev/null +++ b/plugins/SessionLoader/KDE4/sessionLoader.pro.user.2.7pre1 @@ -0,0 +1,208 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE QtCreatorProject> +<!-- Written by Qt Creator 2.6.2, 2013-03-18T13:36:56. --> +<qtcreator> + <data> + <variable>ProjectExplorer.Project.ActiveTarget</variable> + <value type="int">0</value> + </data> + <data> + <variable>ProjectExplorer.Project.EditorSettings</variable> + <valuemap type="QVariantMap"> + <value type="bool" key="EditorConfiguration.AutoIndent">true</value> + <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> + <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value> + <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> + <value type="QString" key="language">Cpp</value> + <valuemap type="QVariantMap" key="value"> + <value type="QString" key="CurrentPreferences">CppGlobal</value> + </valuemap> + </valuemap> + <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> + <value type="QString" key="language">QmlJS</value> + <valuemap type="QVariantMap" key="value"> + <value type="QString" key="CurrentPreferences">QmlJSGlobal</value> + </valuemap> + </valuemap> + <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value> + <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value> + <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> + <value type="int" key="EditorConfiguration.IndentSize">4</value> + <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value> + <value type="bool" key="EditorConfiguration.MouseNavigation">true</value> + <value type="int" key="EditorConfiguration.PaddingMode">1</value> + <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> + <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> + <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> + <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> + <value type="int" key="EditorConfiguration.TabSize">8</value> + <value type="bool" key="EditorConfiguration.UseGlobal">true</value> + <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> + <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> + <value type="bool" key="EditorConfiguration.cleanIndentation">true</value> + <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> + <value type="bool" key="EditorConfiguration.inEntireDocument">true</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.PluginSettings</variable> + <valuemap type="QVariantMap"/> + </data> + <data> + <variable>ProjectExplorer.Project.Target.0</variable> + <valuemap type="QVariantMap"> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 5.01 (qt5-linux)</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 5.01 (qt5-linux)</value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">{55d7d977-66a3-4d72-9331-2ae779c6252a}</value> + <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> + <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> + <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> + <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/home/user/Desktop/ultracopier/sources/plugins/SessionLoader/sessionLoader-build-Desktop_Qt_5_01_qt5_linux-Debug</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> + <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/home/user/Desktop/ultracopier/sources/plugins/SessionLoader/sessionLoader-build-Desktop_Qt_5_01_qt5_linux-Release</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> + <value type="bool" key="Analyzer.Project.UseGlobal">true</value> + <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value> + <value type="int" key="ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase">2</value> + <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value> + <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Executable</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value> + <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> + <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> + <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> + <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> + <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.TargetCount</variable> + <value type="int">1</value> + </data> + <data> + <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> + <value type="QString">{74ab603f-f657-4135-92cf-c93af71b2f91}</value> + </data> + <data> + <variable>ProjectExplorer.Project.Updater.FileVersion</variable> + <value type="int">12</value> + </data> +</qtcreator> diff --git a/plugins/SessionLoader/Windows/DebugEngineMacro.h b/plugins/SessionLoader/Windows/DebugEngineMacro.h index a3dd648..4582010 100644 --- a/plugins/SessionLoader/Windows/DebugEngineMacro.h +++ b/plugins/SessionLoader/Windows/DebugEngineMacro.h @@ -1,12 +1,15 @@ /** \file DebugEngineMacro.h \brief Define the macro for the debug \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef DEBUGENGINEMACRO_H #define DEBUGENGINEMACRO_H +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + /// \brief Macro for the debug log #ifdef ULTRACOPIER_PLUGIN_DEBUG #if defined (__FILE__) && defined (__LINE__) diff --git a/plugins/SessionLoader/Windows/Environment.h b/plugins/SessionLoader/Windows/Environment.h index 94fd104..265a5a6 100644 --- a/plugins/SessionLoader/Windows/Environment.h +++ b/plugins/SessionLoader/Windows/Environment.h @@ -1,8 +1,7 @@ /** \file Environment.h
\brief Define the environment variable and global function
\author alpha_one_x86
-\version 0.3
-\date 2010 */
+\licence GPL3, see the file COPYING */
#include "Variable.h"
/// \brief The global include
diff --git a/plugins/SessionLoader/Windows/Variable.h b/plugins/SessionLoader/Windows/Variable.h index 8179c93..963d0c8 100644 --- a/plugins/SessionLoader/Windows/Variable.h +++ b/plugins/SessionLoader/Windows/Variable.h @@ -1,8 +1,7 @@ /** \file Variable.h
\brief Define the environment variable
\author alpha_one_x86
-\version 0.3
-\date 2010 */
+\licence GPL3, see the file COPYING */
#ifndef VARIABLE_H
#define VARIABLE_H
diff --git a/plugins/SessionLoader/Windows/documentation.dox b/plugins/SessionLoader/Windows/documentation.dox index 5cd8685..67ea43f 100755..100644 --- a/plugins/SessionLoader/Windows/documentation.dox +++ b/plugins/SessionLoader/Windows/documentation.dox @@ -10,13 +10,13 @@ \section mainpage_overview Overview - It control if it loaded with the session.\n - More informations on <a href="http://ultracopier-wiki.first-world.info/">the wiki of ultracopier</a>. Is part of Ultracopier 0.3 project. + It control if it loaded with the session. Use HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Run. \n + More informations on <a href="http://ultracopier-wiki.first-world.info/">the wiki of ultracopier</a>. \section mainpage_platforms Platforms - This plugin might be usable in all environments where you find Qt 4.\n - To be compatible with the official Ultracopier plugins, you need compil it with Gcc, Qt4.8, and same env as Ultracopier have been compiled, see the documentation. + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. \section mainpage_downloads Downloads diff --git a/plugins/SessionLoader/Windows/informations.xml b/plugins/SessionLoader/Windows/informations.xml index 5aea44c..b91bd28 100644 --- a/plugins/SessionLoader/Windows/informations.xml +++ b/plugins/SessionLoader/Windows/informations.xml @@ -17,11 +17,10 @@ <description xml:lang="en"><![CDATA[This plugin allow Ultracopier to be loaded at the session opening under windows]]></description> <description xml:lang="fr"><![CDATA[Ce plugin permet de charger Ultracopier à l'ouverture de la sessions sous windows]]></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>0.3.1.0</version> + <version>1.2.3.6</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>Windows</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. --> <dependencies><![CDATA[ - >=ultracopier-0.3.1.0 ]]></dependencies> </package>
\ No newline at end of file diff --git a/plugins/SessionLoader/Windows/plugin.json b/plugins/SessionLoader/Windows/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/SessionLoader/Windows/plugin.json @@ -0,0 +1 @@ +{}
\ No newline at end of file diff --git a/plugins/SessionLoader/Windows/sessionLoader.cpp b/plugins/SessionLoader/Windows/sessionLoader.cpp index 8e1595c..5080bdc 100755..100644 --- a/plugins/SessionLoader/Windows/sessionLoader.cpp +++ b/plugins/SessionLoader/Windows/sessionLoader.cpp @@ -1,69 +1,80 @@ /** \file session-loader.cpp \brief Define the session plugin loader test -\author alpha_one_x86 -\version 0.3 -\date 2010 */ +\author alpha_one_x86 */ -#include <QtCore> +#include "sessionLoader.h" + +#include <QCoreApplication> -#if defined (Q_OS_WIN32) -#include <windows.h> +#ifdef Q_OS_WIN32 + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include <windows.h> #else -#error "Not under windows, plugin will not work" + #error "This plugin will only work under Windows" #endif -#include "sessionLoader.h" - -void SessionLoader::setEnabled(bool newValue) +void WindowsSessionLoader::setEnabled(const bool &newValue) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, newValue: "+QString::number(newValue)); - //set value into the variable - HKEY ultracopier_regkey; - //for autostart - QString runStringApp = "\"" + QApplication::applicationFilePath() + "\""; - runStringApp.replace( "/", "\\" ); - wchar_t windowsString[255]; - runStringApp.toWCharArray(windowsString); - RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, 0, REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS, 0, &ultracopier_regkey, 0); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, newValue: "+QString::number(newValue)); + //set value into the variable + HKEY ultracopier_regkey; + //for autostart + QString runStringApp = "\"" + QCoreApplication::applicationFilePath() + "\""; + runStringApp.replace( "/", "\\" ); + wchar_t windowsString[255]; + runStringApp.toWCharArray(windowsString); + if(RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, 0, REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS, 0, &ultracopier_regkey, 0)==ERROR_SUCCESS) + { if(newValue) - RegSetValueEx(ultracopier_regkey, TEXT("ultracopier"), 0, REG_SZ, (BYTE*)windowsString, runStringApp.length()*2); - else - RegDeleteValue(ultracopier_regkey, TEXT("ultracopier")); + { + if(RegSetValueEx(ultracopier_regkey, TEXT("ultracopier"), 0, REG_SZ, (BYTE*)windowsString, runStringApp.length()*2)!=ERROR_SUCCESS) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"newValue: "+QString::number(newValue)+" failed"); + } + else + { + if(RegDeleteValue(ultracopier_regkey, TEXT("ultracopier"))!=ERROR_SUCCESS) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"newValue: "+QString::number(newValue)+" failed"); + } RegCloseKey(ultracopier_regkey); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"RegCreateKeyEx: Software\\Microsoft\\Windows\\CurrentVersion\\Run failed"); } -bool SessionLoader::getEnabled() +bool WindowsSessionLoader::getEnabled() const { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //return the value into the variable - HKEY ultracopier_regkey; - bool temp=false; - RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, 0, REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS, 0, &ultracopier_regkey, 0); - DWORD kSize=254; - if(RegQueryValueEx(ultracopier_regkey,TEXT("ultracopier"),NULL,NULL,(LPBYTE)0,&kSize) == ERROR_SUCCESS) - temp=true; - RegCloseKey(ultracopier_regkey); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"return this value: "+QString::number(temp)); - return temp; + //return the value into the variable + HKEY ultracopier_regkey; + bool temp=false; + if(RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, 0, REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS, 0, &ultracopier_regkey, 0)==ERROR_SUCCESS) + { + DWORD kSize=254; + if(RegQueryValueEx(ultracopier_regkey,TEXT("ultracopier"),NULL,NULL,(LPBYTE)0,&kSize) == ERROR_SUCCESS) + temp=true; + RegCloseKey(ultracopier_regkey); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"RegCreateKeyEx: Software\\Microsoft\\Windows\\CurrentVersion\\Run failed"); + return temp; } -void SessionLoader::setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion) +void WindowsSessionLoader::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion) { - Q_UNUSED(options); - Q_UNUSED(writePath); - Q_UNUSED(pluginPath); - Q_UNUSED(portableVersion); + Q_UNUSED(options); + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + Q_UNUSED(portableVersion); } /// \brief to get the options widget, NULL if not have -QWidget * SessionLoader::options() +QWidget * WindowsSessionLoader::options() { - return NULL; + return NULL; } /// \brief to reload the translation, because the new language have been loaded -void SessionLoader::newLanguageLoaded() +void WindowsSessionLoader::newLanguageLoaded() { } - -Q_EXPORT_PLUGIN2(sessionLoader, SessionLoader); diff --git a/plugins/SessionLoader/Windows/sessionLoader.h b/plugins/SessionLoader/Windows/sessionLoader.h index a08ea94..bc8615e 100755..100644 --- a/plugins/SessionLoader/Windows/sessionLoader.h +++ b/plugins/SessionLoader/Windows/sessionLoader.h @@ -1,39 +1,33 @@ /** \file sessionLoader.h \brief Define the session loader \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef SESSION_LOADER_H #define SESSION_LOADER_H #include <QObject> -#include <QApplication> #include "Environment.h" #include "../../../interface/PluginInterface_SessionLoader.h" /// \brief Define the session loader -class SessionLoader : public PluginInterface_SessionLoader +class WindowsSessionLoader : public PluginInterface_SessionLoader { Q_OBJECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.SessionLoader/1.0.0.0" FILE "plugin.json") Q_INTERFACES(PluginInterface_SessionLoader) public: /// \brief to set if it's enabled or not - void setEnabled(bool); + void setEnabled(const bool &newValue); /// \brief to get if is enabled - bool getEnabled(); + bool getEnabled() const; /// \brief set the resources for the plugins - void setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion); + void setResources(OptionInterface * options,const QString &writePath,const QString &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(); -signals: - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif }; #endif // SESSION_LOADER_H diff --git a/plugins/SessionLoader/Windows/sessionLoader.pro b/plugins/SessionLoader/Windows/sessionLoader.pro index c454601..071db7e 100644 --- a/plugins/SessionLoader/Windows/sessionLoader.pro +++ b/plugins/SessionLoader/Windows/sessionLoader.pro @@ -1,5 +1,10 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + TEMPLATE = lib CONFIG += plugin +LIBS += -ladvapi32 HEADERS = sessionLoader.h \ StructEnumDefinition.h \ Variable.h \ |