From cb3c889abf7a4d8b235e9bc2cfcc91d913b042c6 Mon Sep 17 00:00:00 2001 From: Felix Kauselmann <2039670+selmf@users.noreply.github.com> Date: Mon, 18 Aug 2014 23:22:41 +0200 Subject: [PATCH] Use lowercase packagename when installing on linux/unix for easier packaging --- YACReader.desktop | 2 +- YACReader/YACReader.pro | 8 ++++---- YACReader/main.cpp | 2 +- YACReaderLibrary.desktop | 2 +- YACReaderLibrary/YACReaderLibrary.pro | 8 ++++---- YACReaderLibrary/main.cpp | 4 ++-- .../server/lib/bfHttpServer/staticfilecontroller.cpp | 7 ++++--- .../server/lib/bfTemplateEngine/templateloader.cpp | 4 ++-- YACReaderLibrary/server/requestmapper.cpp | 2 +- YACReaderLibrary/server/static.cpp | 2 +- 10 files changed, 21 insertions(+), 20 deletions(-) diff --git a/YACReader.desktop b/YACReader.desktop index 3f33ba25..d68e9ead 100644 --- a/YACReader.desktop +++ b/YACReader.desktop @@ -3,7 +3,7 @@ Name=YACReader GenericName=Yet Another Comic Reader Comment=Yet Another Comic Reader Exec=YACReader %f -Icon=/home/herr_k/builds/yacreader/yacreader/YACReader/test/share/YACReader/icon.png +Icon=/usr/share/yacreader/icon.png Terminal=false Type=Application StartupNotify=true diff --git a/YACReader/YACReader.pro b/YACReader/YACReader.pro index 4ceb6f89..bd330701 100644 --- a/YACReader/YACReader.pro +++ b/YACReader/YACReader.pro @@ -80,22 +80,22 @@ isEmpty(DESTDIR) { bin.files = $$DESTDIR/YACReader } -docs.path = $$DATADIR/doc/YACReader +docs.path = $$DATADIR/doc/yacreader #rename docs for better packageability docs.extra = cp ../CHANGELOG.txt ../changelog; cp ../README.txt ../README docs.files = ../README ../changelog -icon.path = $$DATADIR/YACReader +icon.path = $$DATADIR/yacreader icon.files = ../images/icon.png desktop.path = $$DATADIR/applications -desktop.extra = desktop-file-edit --set-icon=$$DATADIR/YACReader/icon.png $$PWD/../YACReader.desktop +desktop.extra = desktop-file-edit --set-icon=$$DATADIR/yacreader/icon.png $$PWD/../YACReader.desktop desktop.files = ../YACReader.desktop #TODO: icons should be located at /usr/share/icons and have the same basename as their application -translation.path = $$DATADIR/YACReader/languages +translation.path = $$DATADIR/yacreader/languages translation.files = ../release/languages/yacreader_* manpage.path = $$DATADIR/man/man1 diff --git a/YACReader/main.cpp b/YACReader/main.cpp index 70028440..5e4a75d6 100644 --- a/YACReader/main.cpp +++ b/YACReader/main.cpp @@ -129,7 +129,7 @@ int main(int argc, char * argv[]) QTranslator translator; QString sufix = QLocale::system().name(); #if defined Q_OS_UNIX && !defined Q_OS_MAC - translator.load(QString(DATADIR)+"/YACReader/languages/yacreader_"+sufix); + translator.load(QString(DATADIR)+"/yacreader/languages/yacreader_"+sufix); #else translator.load(QCoreApplication::applicationDirPath()+"/languages/yacreader_"+sufix); #endif diff --git a/YACReaderLibrary.desktop b/YACReaderLibrary.desktop index 38551ad7..feb0dc3c 100644 --- a/YACReaderLibrary.desktop +++ b/YACReaderLibrary.desktop @@ -3,7 +3,7 @@ Name=YACReader Library GenericName=Yet Another Comic Reader Comment=Yet Another Comic Reader Exec=YACReaderLibrary %f -Icon=/usr/share/YACReader/iconLibrary.png +Icon=/usr/share/yacreader/iconLibrary.png Terminal=false Type=Application StartupNotify=true diff --git a/YACReaderLibrary/YACReaderLibrary.pro b/YACReaderLibrary/YACReaderLibrary.pro index 42a353c9..c31225d2 100644 --- a/YACReaderLibrary/YACReaderLibrary.pro +++ b/YACReaderLibrary/YACReaderLibrary.pro @@ -230,18 +230,18 @@ isEmpty(DESTDIR) { bin.files = $$DESTDIR/YACReaderLibrary } -server.path = $$DATADIR/YACReader +server.path = $$DATADIR/yacreader server.files = ../release/server -icon.path = $$DATADIR/YACReader +icon.path = $$DATADIR/yacreader icon.files = ../images/iconLibrary.png ../images/db.png ../images/coversPackage.png desktop.path = $$DATADIR/applications -desktop.extra = desktop-file-edit --set-icon=$$DATADIR/YACReader/iconLibrary.png $$PWD/../YACReaderLibrary.desktop +desktop.extra = desktop-file-edit --set-icon=$$DATADIR/yacreader/iconLibrary.png $$PWD/../YACReaderLibrary.desktop desktop.files = ../YACReaderLibrary.desktop #TODO: icons should be located at /usr/share/icons and have the same basename as their application -translation.path = $$DATADIR/YACReader/languages +translation.path = $$DATADIR/yacreader/languages translation.files = ../release/languages/yacreaderlibrary_* manpage.path = $$DATADIR/man/man1 diff --git a/YACReaderLibrary/main.cpp b/YACReaderLibrary/main.cpp index 25f214b9..451a3a1f 100644 --- a/YACReaderLibrary/main.cpp +++ b/YACReaderLibrary/main.cpp @@ -182,7 +182,7 @@ int main( int argc, char ** argv ) QTranslator translator; QString sufix = QLocale::system().name(); #if defined Q_OS_UNIX && !defined Q_OS_MAC - translator.load(QString(DATADIR) +"/YACReader/languages/yacreaderlibrary_"+sufix); + translator.load(QString(DATADIR)+"/yacreader/languages/yacreaderlibrary_"+sufix); #else translator.load(QCoreApplication::applicationDirPath()+"/languages/yacreaderlibrary_"+sufix); #endif @@ -190,7 +190,7 @@ int main( int argc, char ** argv ) QTranslator viewerTranslator; #if defined Q_OS_UNIX && !defined Q_OS_MAC - viewerTranslator.load(QString(DATADIR)+"/YACReader/languages/yacreader_"+sufix); + viewerTranslator.load(QString(DATADIR)+"/yacreader/languages/yacreader_"+sufix); #else viewerTranslator.load(QCoreApplication::applicationDirPath()+"/languages/yacreader_"+sufix); #endif diff --git a/YACReaderLibrary/server/lib/bfHttpServer/staticfilecontroller.cpp b/YACReaderLibrary/server/lib/bfHttpServer/staticfilecontroller.cpp index fde1cf8d..b2515e3c 100644 --- a/YACReaderLibrary/server/lib/bfHttpServer/staticfilecontroller.cpp +++ b/YACReaderLibrary/server/lib/bfHttpServer/staticfilecontroller.cpp @@ -11,6 +11,7 @@ #include "static.h" #include + StaticFileController::StaticFileController(QSettings* settings, QObject* parent) :HttpRequestHandler(parent) { @@ -25,8 +26,8 @@ StaticFileController::StaticFileController(QSettings* settings, QObject* parent) #endif { #if defined Q_OS_UNIX && ! defined Q_OS_MAC - QFileInfo configFile(QString(DATADIR)+"/YACReader"); - docroot=QFileInfo(QString(DATADIR)+"/YACReader",docroot).absoluteFilePath(); + QFileInfo configFile(QString(DATADIR)+"/yacreader"); + docroot=QFileInfo(QString(DATADIR)+"/yacreader",docroot).absoluteFilePath(); #else QFileInfo configFile(QApplication::applicationDirPath()); docroot=QFileInfo(QApplication::applicationDirPath(),docroot).absoluteFilePath(); @@ -220,7 +221,7 @@ QString StaticFileController::getDeviceAwareFileName(QString fileName, QString d QString baseName = fi.baseName(); QString extension = fi.completeSuffix(); - QString completeFileName = completeFileName = baseName+display+"."+extension; + QString completeFileName = baseName+display+"."+extension; if(QFile(docroot+"/"+path+completeFileName).exists()) return completeFileName; else diff --git a/YACReaderLibrary/server/lib/bfTemplateEngine/templateloader.cpp b/YACReaderLibrary/server/lib/bfTemplateEngine/templateloader.cpp index 5cb416e4..ea3a2dd8 100644 --- a/YACReaderLibrary/server/lib/bfTemplateEngine/templateloader.cpp +++ b/YACReaderLibrary/server/lib/bfTemplateEngine/templateloader.cpp @@ -23,8 +23,8 @@ TemplateLoader::TemplateLoader(QSettings* settings, QObject* parent) #endif { #if defined Q_OS_UNIX && !defined Q_OS_MAC - QFileInfo configFile(QString(DATADIR)+"/YACReader"); - templatePath=QFileInfo(QString(DATADIR)+"/YACReader",templatePath).absoluteFilePath(); + QFileInfo configFile(QString(DATADIR)+"/yacreader"); + templatePath=QFileInfo(QString(DATADIR)+"/yacreader",templatePath).absoluteFilePath(); #else QFileInfo configFile(QApplication::applicationDirPath()); templatePath=QFileInfo(QApplication::applicationDirPath(),templatePath).absoluteFilePath(); diff --git a/YACReaderLibrary/server/requestmapper.cpp b/YACReaderLibrary/server/requestmapper.cpp index f867b944..f63eb6d3 100644 --- a/YACReaderLibrary/server/requestmapper.cpp +++ b/YACReaderLibrary/server/requestmapper.cpp @@ -58,7 +58,7 @@ void RequestMapper::service(HttpRequest& request, HttpResponse& response) { HttpSession session=Static::sessionStore->getSession(request,response,false); if(!session.isNull() && session.contains("ySession")) { - if(library.indexIn(path)!=-1 && DBHelper::getLibraries().contains(library.cap(1).toInt()) ) + if(library.indexIn(path)!=-1 && DBHelper::getLibraries().contains(library.cap(1).toInt()) ) { //listar el contenido del folder if(folder.exactMatch(path)) diff --git a/YACReaderLibrary/server/static.cpp b/YACReaderLibrary/server/static.cpp index 38133b66..49e0060e 100644 --- a/YACReaderLibrary/server/static.cpp +++ b/YACReaderLibrary/server/static.cpp @@ -27,7 +27,7 @@ QString Static::getConfigDir() { } // Search config file #if defined Q_OS_UNIX && !defined Q_OS_MAC - QString binDir=(QString(DATADIR) + "/YACReader"); + QString binDir=(QString(DATADIR)+"/yacreader"); #else QString binDir=QCoreApplication::applicationDirPath(); #endif