summaryrefslogtreecommitdiff
path: root/LocalListener.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'LocalListener.cpp')
-rw-r--r--LocalListener.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/LocalListener.cpp b/LocalListener.cpp
index d76b505..3fcee9f 100644
--- a/LocalListener.cpp
+++ b/LocalListener.cpp
@@ -14,6 +14,7 @@ LocalListener::LocalListener(QObject *parent) :
TimeOutQLocalSocket.setInterval(500);
TimeOutQLocalSocket.setSingleShot(true);
connect(&TimeOutQLocalSocket, SIGNAL(timeout()), this, SLOT(timeoutDectected()));
+ connect(plugins,SIGNAL(pluginListingIsfinish()),this,SLOT(allPluginIsloaded()),Qt::QueuedConnection);
}
LocalListener::~LocalListener()
@@ -43,6 +44,7 @@ bool LocalListener::tryConnect()
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"localSocket is not valid!");
return false;
}
+ emit cli(ultracopierArguments,false,true);
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"connection succes, number arguments given: "+QString::number(ultracopierArguments.size()));
#ifdef ULTRACOPIER_DEBUG
for (int i = 0; i < ultracopierArguments.size(); ++i) {
@@ -95,7 +97,6 @@ bool LocalListener::tryConnect()
{
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"connection failed, continu...");
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"ultracopierArguments: "+ultracopierArguments.join(";"));
- emit cli(ultracopierArguments,false);
return false;
}
}
@@ -180,7 +181,7 @@ void LocalListener::dataIncomming()
QStringList ultracopierArguments;
in >> ultracopierArguments;
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"ultracopierArguments: "+ultracopierArguments.join(";"));
- emit cli(ultracopierArguments,true);
+ emit cli(ultracopierArguments,true,false);
clientList[index].data.clear();
clientList[index].haveData=false;
}
@@ -199,7 +200,7 @@ void LocalListener::dataIncomming()
QStringList ultracopierArguments;
in >> ultracopierArguments;
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"ultracopierArguments: "+ultracopierArguments.join(";"));
- emit cli(ultracopierArguments,true);
+ emit cli(ultracopierArguments,true,false);
clientList[index].data.clear();
clientList[index].haveData=false;
}
@@ -263,3 +264,15 @@ void LocalListener::error(QLocalSocket::LocalSocketError theErrorDefine)
}
}
#endif
+
+/// \can now parse the cli
+void LocalListener::allPluginIsloaded()
+{
+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start");
+ QStringList ultracopierArguments=QCoreApplication::arguments();
+ //remove excutable path because is useless (unsafe to use)
+ ultracopierArguments.removeFirst();
+ //add the current path to file full path resolution if needed
+ ultracopierArguments.insert(0,QFSFileEngine::currentPath());
+ emit cli(ultracopierArguments,false,false);
+}