Skip to content

Commit

Permalink
Lot of minor improving, by improving the method prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
alphaonex86 committed Mar 15, 2012
1 parent 47c6c77 commit d5208e5
Show file tree
Hide file tree
Showing 36 changed files with 239 additions and 237 deletions.
4 changes: 2 additions & 2 deletions AuthPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ AuthPlugin::~AuthPlugin()
stop();
}

QStringList AuthPlugin::getFileList(QString path)
QStringList AuthPlugin::getFileList(const QString &path)
{
QStringList list;
QDir dir(path);
Expand Down Expand Up @@ -109,7 +109,7 @@ void AuthPlugin::run()
sem.release();
}

void AuthPlugin::loadSearchPath(QStringList readPath,QStringList searchPathPlugin)
void AuthPlugin::loadSearchPath(const QStringList &readPath,const QStringList &searchPathPlugin)
{
this->readPath=readPath;
this->searchPathPlugin=searchPathPlugin;
Expand Down
4 changes: 2 additions & 2 deletions AuthPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ class AuthPlugin : public QThread
\param readPath list of read place
\param searchPathPlugin list of plugin place
*/
void loadSearchPath(QStringList readPath,QStringList searchPathPlugin);
void loadSearchPath(const QStringList &readPath,const QStringList &searchPathPlugin);
protected:
void run();
private:
bool stopIt;
QSemaphore sem;
QStringList readPath;
QStringList searchPathPlugin;
static QStringList getFileList(QString path);
static QStringList getFileList(const QString &path);
signals:
void authentifiedPath(QString);
};
Expand Down
2 changes: 1 addition & 1 deletion CliParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CliParser::CliParser(QObject *parent) :
{
}

void CliParser::cli(QStringList ultracopierArguments,bool external)
void CliParser::cli(const QStringList &ultracopierArguments,const bool &external)
{
if(ultracopierArguments.size()==1)
{
Expand Down
2 changes: 1 addition & 1 deletion CliParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public slots:
\param ultracopierArguments the argument list
\param external true if the arguments come from other instance of ultracopier
*/
void cli(QStringList ultracopierArguments,bool external);
void cli(const QStringList &ultracopierArguments,const bool &external);
};

#endif // CLIPARSER_H
14 changes: 7 additions & 7 deletions CopyEngineManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ CopyEngineManager::CopyEngineManager(OptionDialog *optionDialog)
connect(languages, SIGNAL(newLanguageLoaded(QString)), &facilityEngine,SLOT(retranslate()));
}

void CopyEngineManager::onePluginAdded(PluginsAvailable plugin)
void CopyEngineManager::onePluginAdded(const PluginsAvailable &plugin)
{
if(plugin.category!=PluginType_CopyEngine)
return;
Expand Down Expand Up @@ -101,7 +101,7 @@ void CopyEngineManager::onePluginAdded(PluginsAvailable plugin)
emit addCopyEngine(newItem.name,newItem.canDoOnlyCopy);
}

void CopyEngineManager::onePluginWillBeRemoved(PluginsAvailable plugin)
void CopyEngineManager::onePluginWillBeRemoved(const PluginsAvailable &plugin)
{
int index=0;
while(index<pluginList.size())
Expand All @@ -120,7 +120,7 @@ void CopyEngineManager::onePluginWillBeRemoved(PluginsAvailable plugin)
}
}

void CopyEngineManager::onePluginWillBeUnloaded(PluginsAvailable plugin)
void CopyEngineManager::onePluginWillBeUnloaded(const PluginsAvailable &plugin)
{
if(plugin.category!=PluginType_CopyEngine)
return;
Expand All @@ -140,7 +140,7 @@ void CopyEngineManager::onePluginWillBeUnloaded(PluginsAvailable plugin)
}
}

CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(CopyMode mode,QStringList protocolsUsedForTheSources,QString protocolsUsedForTheDestination)
CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const CopyMode &mode,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination)
{
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start, pluginList.size(): %1, mode: %2, and particular protocol").arg(pluginList.size()).arg((int)mode));
returnCopyEngine temp;
Expand Down Expand Up @@ -203,7 +203,7 @@ CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(CopyMode mo
return temp;
}

CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(CopyMode mode,QString name)
CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const CopyMode &mode,const QString &name)
{
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start, pluginList.size(): %1, with mode: %2, and name: %3").arg(pluginList.size()).arg((int)mode).arg(name));
returnCopyEngine temp;
Expand Down Expand Up @@ -244,7 +244,7 @@ void CopyEngineManager::debugInformation(DebugLevel level,const QString& fonctio
#endif // ULTRACOPIER_DEBUG

/// \brief To notify when new value into a group have changed
void CopyEngineManager::newOptionValue(QString groupName,QString variableName,QVariant value)
void CopyEngineManager::newOptionValue(const QString &groupName,const QString &variableName,const QVariant &value)
{
if(groupName=="CopyEngine" && variableName=="List")
{
Expand Down Expand Up @@ -318,7 +318,7 @@ void CopyEngineManager::allPluginIsloaded()
pluginList=newPluginList;
}

bool CopyEngineManager::protocolsSupportedByTheCopyEngine(PluginInterface_CopyEngine * engine,QStringList protocolsUsedForTheSources,QString protocolsUsedForTheDestination)
bool CopyEngineManager::protocolsSupportedByTheCopyEngine(PluginInterface_CopyEngine * engine,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination)
{
int index=0;
while(index<pluginList.size())
Expand Down
14 changes: 7 additions & 7 deletions CopyEngineManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ class CopyEngineManager : public QObject, public GlobalClass
\param protocolsUsedForTheDestination list of destination used
\see getCopyEngine()
*/
returnCopyEngine getCopyEngine(CopyMode mode,QStringList protocolsUsedForTheSources,QString protocolsUsedForTheDestination);
returnCopyEngine getCopyEngine(const CopyMode &mode,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination);
/** \brief return copy engine instance with specific engine
\param mode the mode (copy/move)
\param name name of the engine needed
\see getCopyEngine()
*/
returnCopyEngine getCopyEngine(CopyMode mode,QString name);
returnCopyEngine getCopyEngine(const CopyMode &mode,const QString &name);
//bool currentEngineCanDoOnlyCopy(QStringList protocolsUsedForTheSources,QString protocolsUsedForTheDestination="");
//CopyType currentEngineGetCopyType(QStringList protocolsUsedForTheSources,QString protocolsUsedForTheDestination="");
/** \brief to send all signal because all object is connected on it */
Expand All @@ -60,16 +60,16 @@ class CopyEngineManager : public QObject, public GlobalClass
\see Core::newCopy()
\see Core::newMove()
*/
bool protocolsSupportedByTheCopyEngine(PluginInterface_CopyEngine * engine,QStringList protocolsUsedForTheSources,QString protocolsUsedForTheDestination);
bool protocolsSupportedByTheCopyEngine(PluginInterface_CopyEngine * engine,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination);
private slots:
void onePluginAdded(PluginsAvailable plugin);
void onePluginWillBeRemoved(PluginsAvailable plugin);
void onePluginWillBeUnloaded(PluginsAvailable plugin);
void onePluginAdded(const PluginsAvailable &plugin);
void onePluginWillBeRemoved(const PluginsAvailable &plugin);
void onePluginWillBeUnloaded(const PluginsAvailable &plugin);
#ifdef ULTRACOPIER_DEBUG
void debugInformation(DebugLevel level,const QString& fonction,const QString& text,const QString& file,const int& ligne);
#endif // ULTRACOPIER_DEBUG
/// \brief To notify when new value into a group have changed
void newOptionValue(QString groupName,QString variableName,QVariant value);
void newOptionValue(const QString &groupName,const QString &variableName,const QVariant &value);
void allPluginIsloaded();
private:
/// \brief the option interface
Expand Down
16 changes: 8 additions & 8 deletions CopyListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void CopyListener::resendState()
}
}

void CopyListener::onePluginAdded(PluginsAvailable plugin)
void CopyListener::onePluginAdded(const PluginsAvailable &plugin)
{
if(plugin.category!=PluginType_Listener)
return;
Expand Down Expand Up @@ -118,7 +118,7 @@ bool CopyListener::oneListenerIsLoaded()
return (pluginList.size()>0);
}

void CopyListener::onePluginWillBeRemoved(PluginsAvailable plugin)
void CopyListener::onePluginWillBeRemoved(const PluginsAvailable &plugin)
{
if(plugin.category!=PluginType_Listener)
return;
Expand Down Expand Up @@ -148,7 +148,7 @@ void CopyListener::onePluginWillBeRemoved(PluginsAvailable plugin)
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"not found");
}

void CopyListener::newState(ListeningState state)
void CopyListener::newState(const ListeningState &state)
{
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start");
PluginInterface_Listen *temp=qobject_cast<PluginInterface_Listen *>(QObject::sender());
Expand Down Expand Up @@ -202,7 +202,7 @@ void CopyListener::close()
copyRunningList.clear();
}

void CopyListener::copyFinished(const quint32 & orderId,bool withError)
void CopyListener::copyFinished(const quint32 & orderId,const bool &withError)
{
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start");
int index=0;
Expand Down Expand Up @@ -238,7 +238,7 @@ void CopyListener::copyCanceled(const quint32 & orderId)
}
}

void CopyListener::newPluginCopy(quint32 orderId,QStringList sources)
void CopyListener::newPluginCopy(const quint32 &orderId,const QStringList &sources)
{
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"sources: "+sources.join(";"));
PluginInterface_Listen *plugin = qobject_cast<PluginInterface_Listen *>(sender());
Expand All @@ -250,7 +250,7 @@ void CopyListener::newPluginCopy(quint32 orderId,QStringList sources)
emit newCopy(orderId,QStringList() << "file",sources);
}

void CopyListener::newPluginCopy(quint32 orderId,QStringList sources,QString destination)
void CopyListener::newPluginCopy(const quint32 &orderId,const QStringList &sources,const QString &destination)
{
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"sources: "+sources.join(";")+", destination: "+destination);
PluginInterface_Listen *plugin = qobject_cast<PluginInterface_Listen *>(sender());
Expand All @@ -262,7 +262,7 @@ void CopyListener::newPluginCopy(quint32 orderId,QStringList sources,QString des
emit newCopy(orderId,QStringList() << "file",sources,"file",destination);
}

void CopyListener::newPluginMove(quint32 orderId,QStringList sources)
void CopyListener::newPluginMove(const quint32 &orderId,const QStringList &sources)
{
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"sources: "+sources.join(";"));
PluginInterface_Listen *plugin = qobject_cast<PluginInterface_Listen *>(sender());
Expand All @@ -274,7 +274,7 @@ void CopyListener::newPluginMove(quint32 orderId,QStringList sources)
emit newMove(orderId,QStringList() << "file",sources);
}

void CopyListener::newPluginMove(quint32 orderId,QStringList sources,QString destination)
void CopyListener::newPluginMove(const quint32 &orderId,const QStringList &sources,const QString &destination)
{
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"sources: "+sources.join(";")+", destination: "+destination);
PluginInterface_Listen *plugin = qobject_cast<PluginInterface_Listen *>(sender());
Expand Down
16 changes: 8 additions & 8 deletions CopyListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ class CopyListener : public QObject, public GlobalClass
void resendState();
private slots:
//void newPlugin();
void newPluginCopy(quint32 orderId,QStringList sources);
void newPluginCopy(quint32 orderId,QStringList sources,QString destination);
void newPluginMove(quint32 orderId,QStringList sources);
void newPluginMove(quint32 orderId,QStringList sources,QString destination);
void onePluginAdded(PluginsAvailable plugin);
void onePluginWillBeRemoved(PluginsAvailable plugin);
void newState(ListeningState state);
void newPluginCopy(const quint32 &orderId,const QStringList &sources);
void newPluginCopy(const quint32 &orderId,const QStringList &sources,const QString &destination);
void newPluginMove(const quint32 &orderId,const QStringList &sources);
void newPluginMove(const quint32 &orderId,const QStringList &sources,const QString &destination);
void onePluginAdded(const PluginsAvailable &plugin);
void onePluginWillBeRemoved(const PluginsAvailable &plugin);
void newState(const ListeningState &state);
#ifdef ULTRACOPIER_DEBUG
void debugInformation(DebugLevel level,const QString& fonction,const QString& text,const QString& file,const int& ligne);
#endif // ULTRACOPIER_DEBUG
Expand All @@ -48,7 +48,7 @@ class CopyListener : public QObject, public GlobalClass
\see newCopy()
\see newMove()
*/
void copyFinished(const quint32 & orderId,bool withError);
void copyFinished(const quint32 & orderId,const bool &withError);
/** \brief the copy is canceled by the user
\param orderId id used when it have send the copy
\see newCopy()
Expand Down
Loading

0 comments on commit d5208e5

Please sign in to comment.