WIP CLIparser #25

手動合併
crtxcr 將 5 次提交從 wip/cliparser 合併至 master 2020-10-10 21:56:31 +02:00
共有 3 個檔案被更改,包括 9 行新增3 行删除
Showing only changes of commit 6813e54e9b - Show all commits

查看文件

@ -69,9 +69,9 @@ int main(int argc, char *argv[])
SettingsProvider settingsProvider{settings};
EntryProvider entryProvider(settingsProvider.userEntriesPaths(), settingsProvider.systemApplicationsEntriesPaths());
// TODO if setting single instance mode
QLocalSocket localSocket;
localSocket.connectToServer("/tmp/qsrun.socket");
localSocket.connectToServer(settingsProvider.socketPath());
SingleInstanceServer server;
if(localSocket.isOpen() && localSocket.isWritable())
{
@ -84,7 +84,7 @@ int main(int argc, char *argv[])
}
else
{
if(!server.listen("/tmp/qsrun.socket"))
if(!server.listen(settingsProvider.socketPath()))
{
qDebug() << "Failed to listen on socket!";
}

查看文件

@ -33,3 +33,8 @@ QString SettingsProvider::getTerminalCommand() const
{
return settings->value("terminal", "/usr/bin/x-terminal-emulator -e %c").toString();
}
QString SettingsProvider::socketPath() const
{
return settings->value("singleInstanceSocket", "/tmp/qsrun").toString();
}

查看文件

@ -16,6 +16,7 @@ class SettingsProvider
virtual int getMaxCols() const;
virtual bool singleInstanceMode() const;
QString getTerminalCommand() const;
QString socketPath() const;
};
#endif // SETTINGSPROVIDER_H