add more spacing
[personal-kdebase.git] / apps / nsplugins / plugin_paths.cpp
blob40e79b0720e31a0c7469c21915ccf107bf08ec29
1 /*
3 This application scans for Netscape plugins and create a cache and
4 the necessary mimelnk and service files.
7 Copyright (c) 2000 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
8 Stefan Schimanski <1Stein@gmx.de>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 #include "plugin_paths.h"
27 #include <QtCore/QGlobalStatic>
28 #include <ksharedconfig.h>
29 #include <kconfiggroup.h>
30 #include <stdlib.h>
32 QStringList getSearchPaths()
34 QStringList searchPaths;
35 KConfigGroup config(KSharedConfig::openConfig( "kcmnspluginrc", KConfig::NoGlobals ), "Misc");
37 // setup default paths
38 if ( !config.hasKey("scanPaths") ) {
39 QStringList paths;
40 // keep sync with kdebase/apps/konqueror/settings/konqhtml
41 paths.append("$HOME/.mozilla/plugins");
42 paths.append("$HOME/.netscape/plugins");
43 paths.append("/usr/lib/firefox/plugins");
44 paths.append("/usr/lib64/browser-plugins");
45 paths.append("/usr/lib/browser-plugins");
46 paths.append("/usr/local/netscape/plugins");
47 paths.append("/opt/mozilla/plugins");
48 paths.append("/opt/mozilla/lib/plugins");
49 paths.append("/opt/netscape/plugins");
50 paths.append("/opt/netscape/communicator/plugins");
51 paths.append("/usr/lib/netscape/plugins");
52 paths.append("/usr/lib/netscape/plugins-libc5");
53 paths.append("/usr/lib/netscape/plugins-libc6");
54 paths.append("/usr/lib/mozilla/plugins");
55 paths.append("/usr/lib64/netscape/plugins");
56 paths.append("/usr/lib64/mozilla/plugins");
57 paths.append("$MOZILLA_HOME/plugins");
58 config.writeEntry( "scanPaths", paths );
61 // read paths
62 searchPaths = config.readPathEntry( "scanPaths", QStringList() );
64 // append environment variable NPX_PLUGIN_PATH
65 const QStringList envs = QString( qgetenv("NPX_PLUGIN_PATH") ).split(':');
66 QStringList::const_iterator it;
67 for (it = envs.constBegin(); it != envs.constEnd(); ++it)
68 searchPaths.append(*it);
70 return searchPaths;