Skip to content

Commit

Permalink
OSX: Install themes
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed Apr 7, 2017
1 parent b4eba9c commit d64c802
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
8 changes: 7 additions & 1 deletion copyq.pro
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,14 @@ macx {
cp $$_PRO_FILE_PWD_/translations/*.qm copyq.app/Contents/Resources/translations
QMAKE_EXTRA_TARGETS += package_translations

# Package the themes
package_themes.commands = \
mkdir -p copyq.app/Contents/Resources/themes && \
cp $$_PRO_FILE_PWD_/shared/themes/*.ini copyq.app/Contents/Resources/themes
QMAKE_EXTRA_TARGETS += package_themes

# Rename to CopyQ.app to make it look better
bundle_mac.depends = package_frameworks package_plugins package_translations
bundle_mac.depends = package_frameworks package_plugins package_translations package_themes
bundle_mac.target = CopyQ.app
bundle_mac.commands = mv copyq.app CopyQ.app
QMAKE_EXTRA_TARGETS += bundle_mac
Expand Down
2 changes: 1 addition & 1 deletion src/platform/mac/macplatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class MacPlatform : public PlatformNativeInterface

QString translationPrefix();

QString themePrefix() { return QString(); }
QString themePrefix();
};

#endif // MACPLATFORM_H
12 changes: 11 additions & 1 deletion src/platform/mac/macplatform.mm
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ void removeFromLoginItems()
::log("Unable to access shared file list, can't stop auto-load of app", LogWarning);
}
}

QString absoluteResourcesePath(const QString &path)
{
return QCoreApplication::applicationDirPath() + "/../Resources/" + path;
}
} // namespace

PlatformPtr createPlatformNativeInterface()
Expand Down Expand Up @@ -229,7 +234,12 @@ PlatformPtr createPlatformNativeInterface()

QString MacPlatform::translationPrefix()
{
return QCoreApplication::applicationDirPath() + "/../Resources/translations";
return absoluteResourcesePath("translations");
}

QString MacPlatform::themePrefix()
{
return absoluteResourcesePath("themes");
}

PlatformWindowPtr MacPlatform::getCurrentWindow()
Expand Down
1 change: 1 addition & 0 deletions utils/travis/script-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ qt_bin="/usr/local/opt/qt5/bin"
make
make package_plugins
make package_translations
make package_themes

# Create "CopyQ.app/"
"$qt_bin/macdeployqt" CopyQ.app -verbose=2 -always-overwrite
Expand Down

0 comments on commit d64c802

Please sign in to comment.