summaryrefslogtreecommitdiff
path: root/x11-misc/copyq/files/copyq-7.1.0-support-plugin-dir-envvar.patch
blob: 21c60f87011b8b79be70975b74a3da75b9cfa3c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From 32b45b42f0d9dbdaae077f81d11fff7bd2455492 Mon Sep 17 00:00:00 2001
From: Alfred Wingate <parona@protonmail.com>
Date: Wed, 6 Dec 2023 06:16:36 +0200
Subject: [PATCH] itemfactory: Add support for setting plugin dir in the
 environment

Signed-off-by: Alfred Wingate <parona@protonmail.com>
--- a/src/item/itemfactory.cpp
+++ b/src/item/itemfactory.cpp
@@ -31,6 +31,13 @@ namespace {
 
 bool findPluginDir(QDir *pluginsDir)
 {
+    QString pluginDirEnv = qEnvironmentVariable("COPYQ_PLUGIN_DIR");
+    if ( !pluginDirEnv.isEmpty() )
+        pluginsDir->setPath(pluginDirEnv);
+
+    if ( pluginsDir->isReadable() )
+        return true;
+
 #ifdef COPYQ_PLUGIN_PREFIX
     pluginsDir->setPath(COPYQ_PLUGIN_PREFIX);
     if ( pluginsDir->isReadable() )
-- 
2.43.0