mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
QProcess: always use proper process arguments when opening YACReader from the library
This commit is contained in:
parent
0c34d54b86
commit
97cfff3ef2
@ -19,7 +19,7 @@ void AddLibraryDialog::setupUI()
|
||||
textLabel->setBuddy(path);
|
||||
connect(path,SIGNAL(textChanged(QString)),this,SLOT(pathSetted(QString)));
|
||||
|
||||
nameLabel = new QLabel(tr("Library Name : "));
|
||||
nameLabel = new QLabel(tr("Library name : "));
|
||||
nameEdit = new QLineEdit;
|
||||
nameLabel->setBuddy(nameEdit);
|
||||
connect(nameEdit,SIGNAL(textChanged(QString)),this,SLOT(nameSetted(QString)));
|
||||
@ -60,7 +60,7 @@ void AddLibraryDialog::setupUI()
|
||||
imgLabel->setPixmap(p);
|
||||
imgMainLayout->addWidget(imgLabel);//,0,Qt::AlignTop);
|
||||
imgMainLayout->addLayout(mainLayout);
|
||||
|
||||
|
||||
setLayout(imgMainLayout);
|
||||
|
||||
setModal(true);
|
||||
|
@ -18,7 +18,6 @@
|
||||
#ifndef NO_OPENGL
|
||||
#include <QGLFormat>
|
||||
#endif
|
||||
#include <QHeaderView>
|
||||
|
||||
#include <iterator>
|
||||
#include <typeinfo>
|
||||
@ -88,10 +87,6 @@
|
||||
#include <shellapi.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
//#include <QtMacExtras>
|
||||
#endif
|
||||
|
||||
LibraryWindow::LibraryWindow()
|
||||
:QMainWindow(),fullscreen(false),fetching(false),previousFilter(""),removeError(false),status(LibraryWindow::Normal)
|
||||
{
|
||||
@ -124,17 +119,17 @@ void LibraryWindow::setupUI()
|
||||
settings = new QSettings(YACReader::getSettingsPath()+"/YACReaderLibrary.ini",QSettings::IniFormat); //TODO unificar la creación del fichero de config con el servidor
|
||||
settings->beginGroup("libraryConfig");
|
||||
|
||||
historyController = new YACReaderHistoryController(this);
|
||||
historyController = new YACReaderHistoryController(this);
|
||||
|
||||
createActions();
|
||||
doModels();
|
||||
|
||||
doDialogs();
|
||||
doDialogs();
|
||||
doLayout();
|
||||
createToolBars();
|
||||
createMenus();
|
||||
|
||||
navigationController = new YACReaderNavigationController(this, comicsViewsManager);
|
||||
navigationController = new YACReaderNavigationController(this, comicsViewsManager);
|
||||
|
||||
createConnections();
|
||||
|
||||
@ -1778,9 +1773,6 @@ void LibraryWindow::openComic()
|
||||
//Invoke YACReader comicPath comicId libraryId NO-->currentPage bookmark1 bookmark2 bookmark3 brightness contrast gamma
|
||||
bool yacreaderFound = false;
|
||||
|
||||
QString comicIdS = QString("--comicId=") + QString("%1").arg(comicId);
|
||||
QString libraryIdS = QString("--libraryId=") + QString("%1").arg(libraryId);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
QStringList possiblePaths;
|
||||
|
||||
@ -1792,25 +1784,32 @@ void LibraryWindow::openComic()
|
||||
if(QFileInfo(yacreaderPath).exists())
|
||||
{
|
||||
yacreaderFound = true;
|
||||
QProcess::startDetached("open", QStringList() << "-n" << yacreaderPath << "--args" << path << comicIdS << libraryIdS ); /*<< page << bookmark1 << bookmark2 << bookmark3 << brightness << contrast << gamma*///,QStringList() << path);
|
||||
QStringList parameters = QStringList() << "-n" << yacreaderPath << path << (QString("--comicId=") + QString::number(comicId)) << (QString("--libraryId=") + QString::number(libraryId));
|
||||
QProcess::startDetached("open", parameters);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN /* \"%4\" \"%5\" \"%6\" \"%7\" \"%8\" \"%9\" \"%10\" */
|
||||
yacreaderFound = QProcess::startDetached(QDir::cleanPath(QCoreApplication::applicationDirPath())+QString("/YACReader \"%1\" \"%2\" \"%3\"").arg(path).arg(QString("--comicId=") + QString::number(comicId)).arg(QString("--libraryId=") + QString::number(libraryId))/*.arg(page).arg(bookmark1).arg(bookmark2).arg(bookmark3).arg(brightness).arg(contrast).arg(gamma)*/,QStringList());
|
||||
#ifdef Q_OS_WIN
|
||||
QStringList parameters = QStringList() << path << (QString("--comicId=") + QString::number(comicId)) << (QString("--libraryId=") + QString::number(libraryId));
|
||||
yacreaderFound = QProcess::startDetached(QDir::cleanPath(QCoreApplication::applicationDirPath()), parameters);
|
||||
#endif
|
||||
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
QStringList parameters = QStringList() << path << (QString("--comicId=") + QString::number(comicId)) << (QString("--libraryId=") + QString::number(libraryId));
|
||||
yacreaderFound = QProcess::startDetached(QString("YACReader"),parameters);
|
||||
yacreaderFound = QProcess::startDetached(QString("YACReader"),parameters);
|
||||
#endif
|
||||
if(!yacreaderFound)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
QMessageBox::critical(this,tr("YACReader not found"),tr("YACReader not found, YACReader should be installed in the same folder as YACReaderLibrary."));
|
||||
|
||||
setCurrentComicOpened();
|
||||
}
|
||||
#else
|
||||
QMessageBox::critical(this,tr("YACReader not found"),tr("YACReader not found. There might be a problem with your YACReader installation."));
|
||||
#endif
|
||||
}
|
||||
setCurrentComicOpened();
|
||||
}
|
||||
}
|
||||
|
||||
void LibraryWindow::setCurrentComicsStatusReaded(YACReaderComicReadStatus readStatus) {
|
||||
|
Loading…
Reference in New Issue
Block a user