From 8a859540c3cb306844288144a06028dc302408d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 23 Feb 2019 16:35:21 +0100 Subject: Use system libdir when searching for dynamically loaded libraries. This prevents finding an incorrect architecture on multi-arch systems. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- tdeui/ksconfig.cpp | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'tdeui/ksconfig.cpp') diff --git a/tdeui/ksconfig.cpp b/tdeui/ksconfig.cpp index 234882939..6ae9e3d5f 100644 --- a/tdeui/ksconfig.cpp +++ b/tdeui/ksconfig.cpp @@ -444,20 +444,25 @@ void KSpellConfig::getAvailDictsIspell () { dictcombo->insertItem( i18n("ISpell Default") ); // dictionary path - TQFileInfo dir ("/usr/lib" KDELIBSUFF "/ispell"); - if (!dir.exists() || !dir.isDir()) - dir.setFile ("/usr/local/lib" KDELIBSUFF "/ispell"); - if (!dir.exists() || !dir.isDir()) - dir.setFile ("/usr/local/share/ispell"); - if (!dir.exists() || !dir.isDir()) - dir.setFile ("/usr/share/ispell"); - if (!dir.exists() || !dir.isDir()) - dir.setFile ("/usr/pkg/lib"); + TQFileInfo dir; + TQStringList dirs; + dirs + << "/usr/" SYSTEM_LIBDIR "/ispell" + << "/usr/lib/ispell" + << "/usr/local/" SYSTEM_LIBDIR "/ispell" + << "/usr/local/lib/ispell" + << "/usr/local/share/ispell" + << "/usr/share/ispell" + << "/usr/pkg/lib"; + for (TQStringList::ConstIterator it=dirs.begin(); it != dirs.end(); ++it) { + dir.setFile(*it); + if (dir.exists() && dir.isDir()) { + break; + } + } /* TODO get them all instead of just one of them. * If /usr/local/lib exists, it skips the rest - if (!dir.exists() || !dir.isDir()) - dir.setFile ("/usr/local/lib"); - */ + */ if (!dir.exists() || !dir.isDir()) return; kdDebug(750) << "KSpellConfig::getAvailDictsIspell " -- cgit v1.2.1