mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
added QLocalServer::removeServer to YACReaderLocalServer for fixing server start up after a dirty exit
This commit is contained in:
parent
3277a12665
commit
23d5abd329
@ -1026,7 +1026,7 @@ void LibraryWindow::openComic()
|
||||
if(!importedCovers)
|
||||
{
|
||||
ComicDB comic = dmCV->getComic(comicView->currentIndex());
|
||||
QString path = currentPath();
|
||||
QString path = currentPath();
|
||||
QList<ComicDB> siblings = dmCV->getAllComics();
|
||||
|
||||
quint64 comicId = comic.id;
|
||||
@ -1036,7 +1036,9 @@ void LibraryWindow::openComic()
|
||||
// %1 %2 %3 NO-->%4 %5 %6 %7 %8 %9 %10
|
||||
//Invoke YACReader comicPath comicId libraryId NO-->currentPage bookmark1 bookmark2 bookmark3 brightness contrast gamma
|
||||
#ifdef Q_OS_MAC
|
||||
QProcess::startDetached("open", QStringList());// << "-n" << QDir::cleanPath(QCoreApplication::applicationDirPath()+"/../../../YACReader.app") << "--args" << path << QString("%1").arg(comicId) << QString("%1").arg(libraryId)); /*<< page << bookmark1 << bookmark2 << bookmark3 << brightness << contrast << gamma*/);//,QStringList() << path);
|
||||
QString comicIdS = QString("%1").arg(comicId);
|
||||
QString libraryIdS = QString("%1").arg(libraryId);
|
||||
QProcess::startDetached("open", QStringList() << "-n" << QDir::cleanPath(QCoreApplication::applicationDirPath()+"/../../../YACReader.app") << "--args" << path << comicIdS << libraryIdS ); /*<< page << bookmark1 << bookmark2 << bookmark3 << brightness << contrast << gamma*///,QStringList() << path);
|
||||
#else
|
||||
/* \"%4\" \"%5\" \"%6\" \"%7\" \"%8\" \"%9\" \"%10\" */
|
||||
QProcess::startDetached(QDir::cleanPath(QCoreApplication::applicationDirPath())+QString("/YACReader \"%1\" \"%2\" \"%3\"").arg(path).arg(comicId).arg(libraryId)/*.arg(page).arg(bookmark1).arg(bookmark2).arg(bookmark3).arg(brightness).arg(contrast).arg(gamma)*/,QStringList());
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
#include "comic_db.h"
|
||||
|
||||
#include "QsLog.h"
|
||||
|
||||
using namespace YACReader;
|
||||
|
||||
QMutex YACReaderClientConnectionWorker::dbMutex;
|
||||
@ -17,8 +19,9 @@ YACReaderLocalServer::YACReaderLocalServer(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
localServer = new QLocalServer(this);
|
||||
QLocalServer::removeServer(YACREADERLIBRARY_GUID);
|
||||
if (!localServer->listen(YACREADERLIBRARY_GUID)) {
|
||||
//error...........
|
||||
QLOG_ERROR() << "Unable to create local server";
|
||||
}
|
||||
|
||||
connect(localServer, SIGNAL(newConnection()), this, SLOT(sendResponse()));
|
||||
|
Loading…
x
Reference in New Issue
Block a user