Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Sep 13, 2020
1 parent 245a5cf commit 7d726a3
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 40 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ add_definitions(-DCYAN_VERSION="${PROJECT_VERSION}")
add_definitions(-DCYAN_GIT="$ENV{GIT}")

set(MAGICK_PKG_CONFIG "Magick++" CACHE STRING "ImageMagick pkg-config name")
set(SOURCES src/main.cpp src/cyan.cpp src/imageview.cpp src/profiledialog.cpp src/helpdialog.cpp src/openlayerdialog.cpp src/FXX.cpp res/cyan.qrc docs/docs.qrc)
set(HEADERS src/cyan.h src/imageview.cpp src/profiledialog.cpp src/helpdialog.cpp src/openlayerdialog.h src/FXX.h)
set(SOURCES src/main.cpp src/cyan.cpp src/imageview.cpp src/profiledialog.cpp src/helpdialog.cpp src/FXX.cpp res/cyan.qrc docs/docs.qrc)
set(HEADERS src/cyan.h src/imageview.cpp src/profiledialog.cpp src/helpdialog.cpp src/FXX.h)
set(RESOURCE_FILES res/cyan.qrc docs/docs.qrc)
set(RESOURCE_FOLDER res)

Expand Down
2 changes: 0 additions & 2 deletions cyan.pro
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ SOURCES += \
src/FXX.cpp \
src/imageview.cpp \
src/profiledialog.cpp \
src/openlayerdialog.cpp \
src/helpdialog.cpp
HEADERS += \
src/cyan.h \
src/FXX.h \
src/imageview.h \
src/profiledialog.h \
src/openlayerdialog.h \
src/helpdialog.h
RESOURCES += \
res/cyan.qrc \
Expand Down
6 changes: 6 additions & 0 deletions docs/ChangeLog → docs/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.3.0 - TBA

* Enhanced layer support
* UI changes
* Better GIMP detection

## 1.2.2 - 20191103

* Added support for output compression quality
Expand Down
2 changes: 1 addition & 1 deletion docs/docs.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<file>images/cyan-promo-04.png</file>
<file>images/cyan-promo-05.png</file>
<file>cyan.html</file>
<file>ChangeLog</file>
<file>ChangeLog.md</file>
<file>images/cyan-usage-02.png</file>
<file>images/cyan-usage-05.png</file>
<file>images/cyan-usage-06.png</file>
Expand Down
48 changes: 13 additions & 35 deletions src/cyan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ void Cyan::writeConfig()
void Cyan::aboutCyan()
{
QString html, changelog, style, license;
QFile changelogFile(":/docs/ChangeLog");
QFile changelogFile(":/docs/ChangeLog.md");
if (changelogFile.open(QIODevice::ReadOnly)) {
QByteArray data = changelogFile.readAll();
changelog.append(data);
Expand Down Expand Up @@ -1066,11 +1066,12 @@ void Cyan::handlePSDConverted(bool success, const QString &filename)
QMessageBox::information(this,
tr("Export PSD success"),
tr("PSD was saved to %1").arg(filename));
} else {
} else if (!success) {
QMessageBox::warning(this,
tr("Failed to export PSD"),
tr("Unable to save PSD file %1").arg(filename));
}
if (!lockedSaveFileName.isEmpty()) { QTimer::singleShot(0, qApp, SLOT(quit())); }
}

void Cyan::updateImage()
Expand Down Expand Up @@ -1351,42 +1352,19 @@ void Cyan::bitDepthChanged(int index)

void Cyan::gimpPlugin()
{
QStringList versions,folders;
QStringList versions,folders,gimps;
versions << "2.4" << "2.6" << "2.7" << "2.8" << "2.9" << "2.10" << "3.0";
gimps << ".gimp-" << ".config/GIMP-AppImage/" << ".config/GIMP/" << "AppData/Roaming/GIMP/" << "Library/Application Support/GIMP/";
foreach (QString version, versions) {
bool hasDir = false;
QDir gimpDir;
QString gimpPath;
gimpPath.append(QDir::homePath());
gimpPath.append(QDir::separator());
#ifndef Q_OS_MAC
//gimpPath.append(QString(".gimp-%1").arg(version));
gimpPath.append(QString(".config/GIMP-AppImage/%1").arg(version));
if (gimpDir.exists(gimpPath)) { hasDir = true; }
if (!hasDir) {
gimpPath = QString("%1/.config/GIMP/%2").arg(QDir::homePath()).arg(version);
if (gimpDir.exists(gimpPath)) { hasDir = true; }
}
if (!hasDir) {
gimpPath = QString("%1/AppData/Roaming/GIMP/%2/").arg(QDir::homePath()).arg(version);
if (gimpDir.exists(gimpPath)) { hasDir = true; }
}
#else
gimpPath.append("Library/Application Support/GIMP/"+version);
if (gimpDir.exists(gimpPath)) {
hasDir = true;
}
#endif
if (hasDir) {
gimpPath.append(QDir::separator());
gimpPath.append("plug-ins");
if (!gimpDir.exists(gimpPath)) {
gimpDir.mkdir(gimpPath);
foreach (QString gimp, gimps) {
QString configPath = QString("%1/%2%3/plug-ins")
.arg(QDir::homePath())
.arg(gimp)
.arg(version);
if (QFile::exists(configPath)) {
folders << QString("%1/cyan.py").arg(configPath);
qDebug() << "found GIMP folder" << configPath;
}
QString result = gimpPath;
result.append(QDir::separator());
result.append("cyan.py");
folders << result;
}
}

Expand Down

0 comments on commit 7d726a3

Please sign in to comment.