mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-27 10:14:32 +00:00
ref #659 "change deploy icons logick"
This commit is contained in:
parent
e6d940ad76
commit
b62c61e802
@ -21,7 +21,7 @@ function createShortCut {
|
||||
echo "Encoding=UTF-8" >> $DEST_FILE
|
||||
echo "Name=$DEST_NAME" >> $DEST_FILE
|
||||
echo "Type=Application" >> $DEST_FILE
|
||||
echo "Icon=$CQT_INSTALL_DEB_DIR/$ICON" >> $DEST_FILE
|
||||
echo "Icon=$CQT_INSTALL_DEB_DIR/icons/${SRC_FILE%%.*}.png" >> $DEST_FILE
|
||||
echo "Terminal=false" >> $DEST_FILE
|
||||
echo "Exec=$SRC_FILE" >> $DEST_FILE
|
||||
|
||||
|
@ -21,7 +21,7 @@ function generateShortCutCmd(cmd) {
|
||||
"CreateShortcut",
|
||||
"@TargetDir@/" + prefix + "/" + cmd,
|
||||
"@DesktopDir@/" + getBasename(cmd) + ".lnk",
|
||||
"iconPath=@TargetDir@/$ICON",
|
||||
"iconPath=@TargetDir@/" + prefix + "/icons/" + getBasename(cmd) + ".ico",
|
||||
"iconId=0");
|
||||
|
||||
}
|
||||
@ -36,7 +36,7 @@ function generateShortCutCmd(cmd) {
|
||||
Terminal=false\n
|
||||
Exec=\"@TargetDir@/" + prefix + "/" + cmd + "\"\n
|
||||
Name=" + getBasename(cmd) + "\n
|
||||
Icon=@TargetDir@/$ICON\n
|
||||
Icon=@TargetDir@/" + prefix + "/icons/" + getBasename(cmd) + ".png\n
|
||||
Name[en_US]=" + getBasename(cmd));
|
||||
|
||||
console.log("create icons!!! on LINUX done");
|
||||
|
@ -70,7 +70,6 @@ bool iDistribution::unpackFile(const QFileInfo &resource,
|
||||
inputText.replace("$DESCRIPTION", info.Description);
|
||||
inputText.replace("$VERSION", info.Version);
|
||||
inputText.replace("$RELEASEDATA", info.ReleaseData);
|
||||
inputText.replace("$ICON", info.Icon);
|
||||
inputText.replace("$PUBLISHER", info.Publisher);
|
||||
inputText.replace("$HOMEPAGE", info.Homepage);
|
||||
inputText.replace("$PREFIX", info.Prefix);
|
||||
@ -162,7 +161,7 @@ bool iDistribution::collectInfoWithDeployIcons(const DistroModule &pkg,
|
||||
return false;
|
||||
}
|
||||
|
||||
return deployIcon(info, pkg);
|
||||
return deployIcon(pkg);
|
||||
|
||||
}
|
||||
|
||||
@ -272,11 +271,10 @@ QString iDistribution::getName(const DistroModule& pkg) const {
|
||||
return name;
|
||||
}
|
||||
|
||||
bool iDistribution::deployIcon(TemplateInfo &info, const DistroModule& pkg) {
|
||||
bool iDistribution::deployIcon(const DistroModule& pkg) {
|
||||
auto localData = dataLocation(pkg);
|
||||
const DeployConfig *cfg = DeployCore::_config;
|
||||
|
||||
info.Icon = "icons/Icon.png";
|
||||
QSet<QString> icons;
|
||||
for (const auto& target: pkg.targets()) {
|
||||
auto targetObject = cfg->targets().value(target);
|
||||
@ -298,14 +296,18 @@ bool iDistribution::deployIcon(TemplateInfo &info, const DistroModule& pkg) {
|
||||
break;
|
||||
|
||||
QFileInfo iconInfo(icon);
|
||||
info.Icon = releativeLocation(pkg) + "/icons/" + iconInfo.fileName();
|
||||
if (!copyFile(icon, localData + "/icons/", false)) {
|
||||
QFileInfo runScript(targetObject.getRunScriptFile());
|
||||
|
||||
QString dist = localData + "/icons/" + runScript.baseName() + "/" + iconInfo.suffix();
|
||||
|
||||
if (!copyFile(icon, dist, true)) {
|
||||
|
||||
QuasarAppUtils::Params::log(QString("Failed to copy icon: %0.").arg(icon),
|
||||
QuasarAppUtils::Error);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
icons += icon;
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ protected:
|
||||
* @param pkg This is package info
|
||||
* @return true if this method finished successful.
|
||||
*/
|
||||
bool deployIcon(TemplateInfo &info, const DistroModule &pkg);
|
||||
bool deployIcon(const DistroModule &pkg);
|
||||
|
||||
/**
|
||||
* @brief dataLocation This method should be retrun location of application or package files.
|
||||
|
@ -14,7 +14,6 @@ struct DEPLOYSHARED_EXPORT TemplateInfo
|
||||
QString Description;
|
||||
QString Version;
|
||||
QString ReleaseData;
|
||||
QString Icon;
|
||||
QString Publisher;
|
||||
QString Homepage;
|
||||
QString Prefix;
|
||||
|
@ -71,8 +71,8 @@ void parseTargetPrivate(DeployConfig& conf,
|
||||
|
||||
auto &cointainer = conf.targetsEdit();
|
||||
|
||||
for (const auto &iconPair: inputParams) {
|
||||
auto pair = iconPair.split(DeployCore::getSeparator(1), splitbehavior);
|
||||
for (const auto &targetPair: inputParams) {
|
||||
auto pair = targetPair.split(DeployCore::getSeparator(1), splitbehavior);
|
||||
|
||||
if (pair.size() == 1) {
|
||||
QuasarAppUtils::Params::log(QString("Set new default property for all tagets: " + pair.value(0)),
|
||||
|
Loading…
x
Reference in New Issue
Block a user