diff options
author | François Andriot <francois.andriot@free.fr> | 2014-10-05 16:40:33 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-12-23 02:22:51 +0100 |
commit | 1c8f40addacd487fd6ff522b0969a072a28fa55e (patch) | |
tree | ea54e94eed8d55b64b272879c85e7d046b9e82d1 /kdeprint/cups/kmcupsmanager.cpp | |
parent | 50c0b04fd4a58309064112cd25ac18ec39f43b6e (diff) | |
download | tdelibs-1c8f40addacd487fd6ff522b0969a072a28fa55e.tar.gz tdelibs-1c8f40addacd487fd6ff522b0969a072a28fa55e.zip |
Fix cups default directories on openbsd
(cherry picked from commit 69e7a5c4fa39591e0cb5f1774707bf84d8c0fd9b)
Diffstat (limited to 'kdeprint/cups/kmcupsmanager.cpp')
-rw-r--r-- | kdeprint/cups/kmcupsmanager.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/kdeprint/cups/kmcupsmanager.cpp b/kdeprint/cups/kmcupsmanager.cpp index 69f14bfd2..df2c5d91e 100644 --- a/kdeprint/cups/kmcupsmanager.cpp +++ b/kdeprint/cups/kmcupsmanager.cpp @@ -101,11 +101,20 @@ TQString KMCupsManager::driverDbCreationProgram() TQString KMCupsManager::driverDirectory() { TQString d = cupsInstallDir(); - if (d.isEmpty()) + if (d.isEmpty()) { +#ifdef __OpenBSD__ + d = "/usr/local"; +#else d = "/usr"; +#endif + } d.append("/share/cups/model"); // raw foomatic support +#ifdef __OpenBSD__ + d.append(":/usr/local/share/foomatic/db/source"); +#else d.append(":/usr/share/foomatic/db/source"); +#endif return d; } @@ -138,7 +147,7 @@ bool KMCupsManager::createPrinter(KMPrinter *p) req.setOperation(CUPS_ADD_CLASS); TQStringList members = p->members(), uris; TQString s; - s = TQString::fromLocal8Bit("ipp://%1/printers/").arg(CupsInfos::self()->hostaddr()); + s = TQString::fromLocal8Bit("ipp://%1/printers/").arg(CupsInfos::self()->hostaddr()); for (TQStringList::ConstIterator it=members.begin(); it!=members.end(); ++it) uris.append(s+(*it)); req.addURI(IPP_TAG_PRINTER,"member-uris",uris); @@ -627,7 +636,11 @@ DrMain* KMCupsManager::loadMaticDriver(const TQString& drname) { TQStringList comps = TQStringList::split('/', drname, false); TQString tmpFile = locateLocal("tmp", "foomatic_" + kapp->randomString(8)); +#ifdef __OpenBSD__ + TQString PATH = getenv("PATH") + TQString::fromLatin1(":/usr/local/bin:/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin"); +#else TQString PATH = getenv("PATH") + TQString::fromLatin1(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin"); +#endif TQString exe = KStandardDirs::findExe("foomatic-datafile", PATH); if (exe.isEmpty()) { @@ -937,10 +950,15 @@ void KMCupsManager::exportDriver() !m_currentprinter->isClass(true) && !m_currentprinter->isSpecial()) { TQString path = cupsInstallDir(); - if (path.isEmpty()) + if (path.isEmpty()) { +#ifdef __OpenBSD__ + path = "/usr/local/share/cups"; +#else path = "/usr/share/cups"; - else +#endif + } else { path += "/share/cups"; + } CupsAddSmb::exportDest(m_currentprinter->printerName(), path); } } |