Skip to content

Commit 0e76277

Browse files
committed
Add support for NC 21
Signed-off-by: ACTom <i@actom.me>
1 parent 60f7963 commit 0e76277

4 files changed

Lines changed: 25 additions & 18 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ source_dir=$(build_dir)/source
77
sign_dir=$(build_dir)/sign
88
package_name=$(app_name)
99
cert_dir=$(CURDIR)/../../key
10-
version+=0.0.23
10+
version+=0.0.24
1111

1212
all: appstore
1313

appinfo/info.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
<name>Mind Map</name>
66
<summary>A Mind map editor</summary>
77
<description><![CDATA[This application enables Nextcloud users to open, save and edit mind map files in the web browser. If enabled, an entry in the New button at the top of the web browser the Mindmap file entry appears. When clicked, a new mindmap file opens in the browser and the file can be saved into the current Nextcloud directory.]]></description>
8-
<version>0.0.23</version>
8+
<version>0.0.24</version>
99
<licence>agpl</licence>
1010
<author mail="i@actom.me" homepage="https://actom.me">Jingtao Yan</author>
1111
<namespace>Files_MindMap</namespace>
1212
<category>files</category>
1313
<category>office</category>
14+
<website>https://github.com/ACTom/files_mindmap</website>
1415
<bugs>https://github.com/ACTom/files_mindmap/issues</bugs>
1516
<repository type="git">https://github.com/ACTom/files_mindmap.git</repository>
16-
<website>https://github.com/ACTom/files_mindmap</website>
1717
<screenshot small-thumbnail="https://raw.githubusercontent.com/ACTom/files_mindmap/master/screenshots/1-small.png">https://raw.githubusercontent.com/ACTom/files_mindmap/master/screenshots/1.png</screenshot>
1818
<screenshot small-thumbnail="https://raw.githubusercontent.com/ACTom/files_mindmap/master/screenshots/2-small.png">https://raw.githubusercontent.com/ACTom/files_mindmap/master/screenshots/2.png</screenshot>
1919
<screenshot small-thumbnail="https://raw.githubusercontent.com/ACTom/files_mindmap/master/screenshots/3-small.png">https://raw.githubusercontent.com/ACTom/files_mindmap/master/screenshots/3.png</screenshot>
2020
<dependencies>
21-
<nextcloud min-version="14" max-version="20"/>
21+
<nextcloud min-version="14" max-version="21"/>
2222
</dependencies>
2323
<repair-steps>
2424
<install>

lib/Migration/InstallStep.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@ public function getName() {
3131
/**
3232
* @param IOutput $output
3333
*/
34-
public function run(IOutput $output) {
34+
public function run(IOutput $output) {
3535
$currentVersion = implode('.', \OC_Util::getVersion());
3636

37-
$this->logger->info("Copy mindmap icon to core/img directory.", ["app" => "files_mindmap"]);
38-
$appImagePath = __DIR__ . '/../../img/mindmap.svg';
39-
$coreImagePath = \OC::$SERVERROOT . '/core/img/filetypes/mindmap.svg';
40-
if (!file_exists($coreImagePath) || md5_file($coreImagePath) !== md5_file($appImagePath)) {
41-
copy($appImagePath, $coreImagePath);
37+
if (version_compare($currentVersion, '21.0.0.11', '<')) {
38+
/* Since 21.0.0 beta4, NC has mindmap's mimetype icon */
39+
$this->logger->info("Copy mindmap icon to core/img directory.", ["app" => "files_mindmap"]);
40+
$appImagePath = __DIR__ . '/../../img/mindmap.svg';
41+
$coreImagePath = \OC::$SERVERROOT . '/core/img/filetypes/mindmap.svg';
42+
if (!file_exists($coreImagePath) || md5_file($coreImagePath) !== md5_file($appImagePath)) {
43+
copy($appImagePath, $coreImagePath);
44+
}
4245
}
4346

4447
if (version_compare($currentVersion, '19.0.0.4', '<')) {

lib/Migration/UninstallStep.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,18 @@ public function getName() {
3030
* @param IOutput $output
3131
*/
3232
public function run(IOutput $output) {
33-
$configDir = \OC::$configDir;
34-
$mimetypealiasesFile = $configDir . 'mimetypealiases.json';
35-
$mimetypemappingFile = $configDir . 'mimetypemapping.json';
36-
37-
$this->removeFromFile($mimetypealiasesFile, ['application/km' => 'mindmap', 'application/x-freemind' => 'mindmap', 'application/vnd.xmind.workbook' => 'mindmap']);
38-
$this->removeFromFile($mimetypemappingFile, ['km' => ['application/km'], 'mm' => ['application/x-freemind'], 'xmind' => ['application/vnd.xmind.workbook']]);
39-
$this->logger->info("Remove .km,.mm,.xmind from mimetype list.", ["app" => "files_mindmap"]);
40-
$this->updateJS->run(new StringInput(''), new ConsoleOutput());
33+
$currentVersion = implode('.', \OC_Util::getVersion());
34+
if (version_compare($currentVersion, '19.0.0.4', '<')) {
35+
/* Since 19.0.0.beta3, NC has mindmap's mimetype */
36+
$configDir = \OC::$configDir;
37+
$mimetypealiasesFile = $configDir . 'mimetypealiases.json';
38+
$mimetypemappingFile = $configDir . 'mimetypemapping.json';
39+
40+
$this->removeFromFile($mimetypealiasesFile, ['application/km' => 'mindmap', 'application/x-freemind' => 'mindmap', 'application/vnd.xmind.workbook' => 'mindmap']);
41+
$this->removeFromFile($mimetypemappingFile, ['km' => ['application/km'], 'mm' => ['application/x-freemind'], 'xmind' => ['application/vnd.xmind.workbook']]);
42+
$this->logger->info("Remove .km,.mm,.xmind from mimetype list.", ["app" => "files_mindmap"]);
43+
$this->updateJS->run(new StringInput(''), new ConsoleOutput());
44+
}
4145
}
4246

4347
private function removeFromFile(string $filename, array $data) {

0 commit comments

Comments
 (0)