Embed resources into executable.
This commit is contained in:
parent
1acb59f2ff
commit
b904f6f109
5 changed files with 804 additions and 880 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -23,3 +23,4 @@
|
||||||
# Other files.
|
# Other files.
|
||||||
*.autosave
|
*.autosave
|
||||||
*.user*
|
*.user*
|
||||||
|
resources/localizations
|
||||||
|
|
78
rssguard.pro
78
rssguard.pro
|
@ -207,6 +207,8 @@ win32 {
|
||||||
QMAKE_TARGET_PRODUCT = $$APP_NAME
|
QMAKE_TARGET_PRODUCT = $$APP_NAME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESOURCES += resources/rssguard.qrc
|
||||||
|
|
||||||
HEADERS += src/core/feeddownloader.h \
|
HEADERS += src/core/feeddownloader.h \
|
||||||
src/core/feedsmodel.h \
|
src/core/feedsmodel.h \
|
||||||
src/core/feedsproxymodel.h \
|
src/core/feedsproxymodel.h \
|
||||||
|
@ -612,10 +614,10 @@ TEXTS = resources/text/CHANGELOG \
|
||||||
resources/text/COPYING_GNU_GPL \
|
resources/text/COPYING_GNU_GPL \
|
||||||
resources/text/COPYING_GNU_GPL_HTML
|
resources/text/COPYING_GNU_GPL_HTML
|
||||||
|
|
||||||
# Make sure QM translations are generated.
|
# Make sure QM translations are gnerated.
|
||||||
lrelease.input = TRANSLATIONS
|
lrelease.input = TRANSLATIONS
|
||||||
lrelease.output = $$OUT_PWD/translations/${QMAKE_FILE_BASE}.qm
|
lrelease.output = $$PWD/resources/localizations/${QMAKE_FILE_BASE}.qm
|
||||||
lrelease.commands = $$LRELEASE_EXECUTABLE -compress ${QMAKE_FILE_IN} -qm $$OUT_PWD/translations/${QMAKE_FILE_BASE}.qm
|
lrelease.commands = $$LRELEASE_EXECUTABLE -compress ${QMAKE_FILE_IN} -qm $$PWD/resources/localizations/${QMAKE_FILE_BASE}.qm
|
||||||
lrelease.CONFIG += no_link target_predeps
|
lrelease.CONFIG += no_link target_predeps
|
||||||
|
|
||||||
# Create new "make lupdate" target.
|
# Create new "make lupdate" target.
|
||||||
|
@ -743,45 +745,14 @@ win32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install all files on Linux.
|
# Install all files on Linux.
|
||||||
unix:!mac {
|
unix:!mac:!android {
|
||||||
target.path = $$PREFIX/bin
|
target.path = $$PREFIX/bin
|
||||||
|
|
||||||
# Install SQL initializers.
|
|
||||||
misc_sql.files = resources/sql/*.sql
|
|
||||||
misc_sql.path = $$quote($$PREFIX/share/$$TARGET/sql/)
|
|
||||||
|
|
||||||
# Misc icons.
|
|
||||||
misc_icons.files = resources/graphics/misc
|
|
||||||
misc_icons.path = $$quote($$PREFIX/share/$$TARGET/icons/)
|
|
||||||
|
|
||||||
# Initial feeds.
|
# Initial feeds.
|
||||||
misc_feeds.files = resources/initial_feeds
|
|
||||||
misc_feeds.path = $$quote($$PREFIX/share/$$TARGET/)
|
|
||||||
|
|
||||||
misc_icon.files = resources/graphics/$${TARGET}.png
|
|
||||||
misc_icon.path = $$quote($$PREFIX/share/pixmaps/)
|
|
||||||
|
|
||||||
skins.files = resources/skins
|
|
||||||
skins.path = $$quote($$PREFIX/share/$$TARGET/)
|
|
||||||
|
|
||||||
misc_plain_icon.files = resources/graphics/$${TARGET}_plain.png
|
|
||||||
misc_plain_icon.path = $$quote($$PREFIX/share/$$TARGET/icons/)
|
|
||||||
|
|
||||||
misc_texts.files = $$TEXTS
|
|
||||||
misc_texts.path = $$quote($$PREFIX/share/$$TARGET/information/)
|
|
||||||
|
|
||||||
desktop_file.files = resources/desktop/$${TARGET}.desktop
|
desktop_file.files = resources/desktop/$${TARGET}.desktop
|
||||||
desktop_file.path = $$quote($$PREFIX/share/applications/)
|
desktop_file.path = $$quote($$PREFIX/share/applications/)
|
||||||
|
|
||||||
desktop_file_autostart.files = resources/desktop/$${TARGET}.desktop.autostart
|
INSTALLS += target desktop_file
|
||||||
desktop_file_autostart.path = $$quote($$PREFIX/share/$${TARGET}/autostart/)
|
|
||||||
|
|
||||||
translations.files = $$OUT_PWD/translations
|
|
||||||
translations.path = $$quote($$PREFIX/share/$$TARGET/)
|
|
||||||
|
|
||||||
INSTALLS += target misc_sql misc_icons misc_feeds \
|
|
||||||
misc_icon misc_plain_icon skins misc_texts \
|
|
||||||
desktop_file desktop_file_autostart translations
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mac {
|
mac {
|
||||||
|
@ -811,38 +782,5 @@ mac {
|
||||||
pkginfo.extra = @printf "APPL????" > $$shell_quote($$PREFIX/Contents/PkgInfo)
|
pkginfo.extra = @printf "APPL????" > $$shell_quote($$PREFIX/Contents/PkgInfo)
|
||||||
pkginfo.path = $$quote($$PREFIX/Contents/)
|
pkginfo.path = $$quote($$PREFIX/Contents/)
|
||||||
|
|
||||||
# Install SQL initializers.
|
INSTALLS += target icns_icon info_plist info_plist2 pkginfo
|
||||||
misc_sql.files = resources/sql
|
|
||||||
misc_sql.path = $$quote($$PREFIX/Contents/Resources/)
|
|
||||||
|
|
||||||
# Misc icons.
|
|
||||||
misc_icons.files = resources/graphics/misc
|
|
||||||
misc_icons.path = $$quote($$PREFIX/Contents/Resources/icons/)
|
|
||||||
|
|
||||||
faenza.files = resources/graphics/Faenza
|
|
||||||
faenza.path = $$quote($$PREFIX/Contents/Resources/icons/)
|
|
||||||
|
|
||||||
# Initial feeds.
|
|
||||||
misc_feeds.files = resources/initial_feeds
|
|
||||||
misc_feeds.path = $$quote($$PREFIX/Contents/Resources/)
|
|
||||||
|
|
||||||
skins.files = resources/skins
|
|
||||||
skins.path = $$quote($$PREFIX/Contents/Resources)
|
|
||||||
|
|
||||||
misc_icon.files = resources/graphics/$${TARGET}.png
|
|
||||||
misc_icon.path = $$quote($$PREFIX/Contents/Resources/icons)
|
|
||||||
|
|
||||||
misc_plain_icon.files = resources/graphics/$${TARGET}_plain.png
|
|
||||||
misc_plain_icon.path = $$quote($$PREFIX/Contents/Resources/icons/)
|
|
||||||
|
|
||||||
misc_texts.files = $$TEXTS
|
|
||||||
misc_texts.path = $$quote($$PREFIX/Contents/Resources/information/)
|
|
||||||
|
|
||||||
translations.files = $$OUT_PWD/translations
|
|
||||||
translations.path = $$quote($$PREFIX/Contents/Resources/)
|
|
||||||
|
|
||||||
INSTALLS += target icns_icon info_plist info_plist2 pkginfo \
|
|
||||||
misc_sql misc_icons faenza misc_feeds skins \
|
|
||||||
misc_icon misc_plain_icon misc_texts translations
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,6 @@
|
||||||
#define DEFAULT_FEED_TYPE "RSS"
|
#define DEFAULT_FEED_TYPE "RSS"
|
||||||
#define URL_REGEXP \
|
#define URL_REGEXP \
|
||||||
"^(http|https|feed|ftp):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&:/~\\+#]*[\\w\\-\\@?^=%&/~\\+#])?$"
|
"^(http|https|feed|ftp):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&:/~\\+#]*[\\w\\-\\@?^=%&/~\\+#])?$"
|
||||||
#define USER_AGENT_HTTP_HEADER "User-Agent"
|
|
||||||
#define TEXT_TITLE_LIMIT 30
|
#define TEXT_TITLE_LIMIT 30
|
||||||
#define RESELECT_MESSAGE_THRESSHOLD 500
|
#define RESELECT_MESSAGE_THRESSHOLD 500
|
||||||
#define ICON_SIZE_SETTINGS 16
|
#define ICON_SIZE_SETTINGS 16
|
||||||
|
@ -92,6 +91,7 @@
|
||||||
#define HTTP_HEADERS_ACCEPT "Accept"
|
#define HTTP_HEADERS_ACCEPT "Accept"
|
||||||
#define HTTP_HEADERS_CONTENT_TYPE "Content-Type"
|
#define HTTP_HEADERS_CONTENT_TYPE "Content-Type"
|
||||||
#define HTTP_HEADERS_AUTHORIZATION "Authorization"
|
#define HTTP_HEADERS_AUTHORIZATION "Authorization"
|
||||||
|
#define HTTP_HEADERS_USER_AGENT "User-Agent"
|
||||||
|
|
||||||
#define MAX_ZOOM_FACTOR 5.0f
|
#define MAX_ZOOM_FACTOR 5.0f
|
||||||
#define MIN_ZOOM_FACTOR 0.25f
|
#define MIN_ZOOM_FACTOR 0.25f
|
||||||
|
@ -224,42 +224,27 @@
|
||||||
#define OS_ID "Mac OS X"
|
#define OS_ID "Mac OS X"
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
#define OS_ID "Windows"
|
#define OS_ID "Windows"
|
||||||
|
#elif defined(Q_OS_ANDROID)
|
||||||
|
#define OS_ID "Android"
|
||||||
#else
|
#else
|
||||||
#define OS_ID ""
|
#define OS_ID ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Paths.
|
||||||
|
#define APP_THEME_PATH QSL(":/graphics")
|
||||||
|
#define APP_SQL_PATH QSL(":/sql")
|
||||||
|
#define APP_INFO_PATH QSL(":/text")
|
||||||
|
#define APP_ICON_PATH QSL(":/graphics/rssguard.png")
|
||||||
|
#define APP_ICON_PLAIN_PATH QSL(":/graphics/rssguard_plain.png")
|
||||||
|
#define APP_SKIN_PATH QSL(":/skins")
|
||||||
|
#define APP_INITIAL_FEEDS_PATH QSL(":/initial_feeds")
|
||||||
|
#define APP_LANG_PATH QSL(":/localizations")
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
#define APP_DESKTOP_SOURCE_ENTRY_FILE "rssguard.desktop.autostart"
|
#define APP_DESKTOP_SOURCE_ENTRY_FILE "rssguard.desktop.autostart"
|
||||||
#define APP_DESKTOP_ENTRY_FILE "rssguard.desktop"
|
#define APP_DESKTOP_ENTRY_FILE "rssguard.desktop"
|
||||||
|
|
||||||
#define APP_DESKTOP_ENTRY_PATH QApplication::applicationDirPath() + QString("/../share/rssguard/autostart")
|
#define APP_DESKTOP_ENTRY_PATH QSL(":/desktop")
|
||||||
#define APP_LANG_PATH QApplication::applicationDirPath() + QString("/../share/rssguard/translations")
|
|
||||||
#define APP_SKIN_PATH QApplication::applicationDirPath() + QString("/../share/rssguard/skins")
|
|
||||||
#define APP_INFO_PATH QApplication::applicationDirPath() + QString("/../share/rssguard/information")
|
|
||||||
#define APP_THEME_PATH QApplication::applicationDirPath() + QString("/../share/rssguard/icons")
|
|
||||||
#define APP_SQL_PATH QApplication::applicationDirPath() + QString("/../share/rssguard/sql")
|
|
||||||
#define APP_ICON_PATH QApplication::applicationDirPath() + QString("/../share/pixmaps/rssguard.png")
|
|
||||||
#define APP_ICON_PLAIN_PATH QApplication::applicationDirPath() + QString("/../share/rssguard/icons/rssguard_plain.png")
|
|
||||||
#define APP_INITIAL_FEEDS_PATH QApplication::applicationDirPath() + QString("/../share/rssguard/initial_feeds")
|
|
||||||
#elif defined(Q_OS_OSX)
|
|
||||||
#define APP_LANG_PATH QApplication::applicationDirPath() + QString("/../Resources/translations")
|
|
||||||
#define APP_SKIN_PATH QApplication::applicationDirPath() + QString("/../Resources/skins")
|
|
||||||
#define APP_INFO_PATH QApplication::applicationDirPath() + QString("/../Resources/information")
|
|
||||||
#define APP_THEME_PATH QApplication::applicationDirPath() + QString("/../Resources/icons")
|
|
||||||
#define APP_SQL_PATH QApplication::applicationDirPath() + QString("/../Resources/sql")
|
|
||||||
#define APP_ICON_PATH QApplication::applicationDirPath() + QString("/../Resources/icons/rssguard.png")
|
|
||||||
#define APP_INFO_PATH QApplication::applicationDirPath() + QString("/../Resources/information")
|
|
||||||
#define APP_ICON_PLAIN_PATH QApplication::applicationDirPath() + QString("/../Resources/icons/rssguard_plain.png")
|
|
||||||
#define APP_INITIAL_FEEDS_PATH QApplication::applicationDirPath() + QString("/../Resources/initial_feeds")
|
|
||||||
#elif defined(Q_OS_WIN)
|
|
||||||
#define APP_LANG_PATH QApplication::applicationDirPath() + QString("/translations")
|
|
||||||
#define APP_SKIN_PATH QApplication::applicationDirPath() + QString("/skins")
|
|
||||||
#define APP_INFO_PATH QApplication::applicationDirPath()
|
|
||||||
#define APP_THEME_PATH QApplication::applicationDirPath() + QString("/icons")
|
|
||||||
#define APP_SQL_PATH QApplication::applicationDirPath() + QString("/sql")
|
|
||||||
#define APP_ICON_PATH QApplication::applicationDirPath() + QString("/rssguard.png")
|
|
||||||
#define APP_ICON_PLAIN_PATH QApplication::applicationDirPath() + QString("/rssguard_plain.png")
|
|
||||||
#define APP_INITIAL_FEEDS_PATH QApplication::applicationDirPath() + QString("/initial_feeds")
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // DEFINITIONS_H
|
#endif // DEFINITIONS_H
|
||||||
|
|
|
@ -120,7 +120,7 @@ void IconFactory::loadCurrentIconTheme() {
|
||||||
QStringList IconFactory::installedIconThemes() const {
|
QStringList IconFactory::installedIconThemes() const {
|
||||||
QStringList icon_theme_names;
|
QStringList icon_theme_names;
|
||||||
|
|
||||||
icon_theme_names << APP_NO_THEME;
|
icon_theme_names << APP_NO_THEME; //<< QSL("Faenza");
|
||||||
|
|
||||||
// Iterate all directories with icon themes.
|
// Iterate all directories with icon themes.
|
||||||
QStringList icon_themes_paths = QIcon::themeSearchPaths();
|
QStringList icon_themes_paths = QIcon::themeSearchPaths();
|
||||||
|
|
|
@ -77,6 +77,6 @@ QNetworkReply* BaseNetworkAccessManager::createRequest(QNetworkAccessManager::Op
|
||||||
new_request.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
|
new_request.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
|
||||||
|
|
||||||
// Setup custom user-agent.
|
// Setup custom user-agent.
|
||||||
new_request.setRawHeader(USER_AGENT_HTTP_HEADER, QString(APP_USERAGENT).toLocal8Bit());
|
new_request.setRawHeader(HTTP_HEADERS_USER_AGENT, QString(APP_USERAGENT).toLocal8Bit());
|
||||||
return QNetworkAccessManager::createRequest(op, new_request, outgoingData);
|
return QNetworkAccessManager::createRequest(op, new_request, outgoingData);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue