diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2013-01-06 16:08:04 -0600 |
---|---|---|
committer | Darrell Anderson <humanreadable@yahoo.com> | 2013-01-06 16:08:04 -0600 |
commit | 01e9b41e1b0412e7281e9ef5c0df586bb66d8763 (patch) | |
tree | 77d00c190b16059923089737eff1628ab4e6bd0e | |
parent | f729994a55534dc59043e3c5aa223651b040a0b1 (diff) | |
parent | 5f99a2718025c4f2fbef86a450423a9c61e297f9 (diff) | |
download | tdelibs-01e9b41e1b0412e7281e9ef5c0df586bb66d8763.tar.gz tdelibs-01e9b41e1b0412e7281e9ef5c0df586bb66d8763.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tdelibs
-rw-r--r-- | kutils/kcmultidialog.cpp | 8 | ||||
-rw-r--r-- | kutils/kcmultidialog.h | 8 | ||||
-rw-r--r-- | tdeprint/cups/ipprequest.cpp | 22 |
3 files changed, 24 insertions, 14 deletions
diff --git a/kutils/kcmultidialog.cpp b/kutils/kcmultidialog.cpp index 53934349e..58c196abc 100644 --- a/kutils/kcmultidialog.cpp +++ b/kutils/kcmultidialog.cpp @@ -219,7 +219,7 @@ void KCMultiDialog::clientChanged(bool state) enableButton( Apply, false ); } -void KCMultiDialog::addModule(const TQString& path, bool withfallback) +void KCMultiDialog::addModule(const TQString& path, bool withfallback, TQStringList args) { TQString complete = path; @@ -228,11 +228,11 @@ void KCMultiDialog::addModule(const TQString& path, bool withfallback) KService::Ptr service = KService::serviceByStorageId( complete ); - addModule( KCModuleInfo( service ), TQStringList(), withfallback); + addModule( KCModuleInfo( service ), TQStringList(), withfallback, args ); } void KCMultiDialog::addModule(const KCModuleInfo& moduleinfo, - TQStringList parentmodulenames, bool withfallback) + TQStringList parentmodulenames, bool withfallback, TQStringList args) { kdDebug(710) << "KCMultiDialog::addModule " << moduleinfo.moduleName() << endl; @@ -294,7 +294,7 @@ void KCMultiDialog::addModule(const KCModuleInfo& moduleinfo, } else { - module = new KCModuleProxy( moduleinfo, withfallback, page ); + module = new KCModuleProxy( moduleinfo, withfallback, page, 0, args ); TQStringList parentComponents = moduleinfo.service()->property( "X-TDE-ParentComponents" ).toStringList(); moduleParentComponents.insert( module, diff --git a/kutils/kcmultidialog.h b/kutils/kcmultidialog.h index ab57012ad..c26836e31 100644 --- a/kutils/kcmultidialog.h +++ b/kutils/kcmultidialog.h @@ -118,8 +118,10 @@ public: * * @param withfallback Try harder to load the module. Might result * in the module appearing outside the dialog. + * + * @param args List of arguments to pass to the module. **/ - void addModule(const TQString& module, bool withfallback=true); + void addModule(const TQString& module, bool withfallback=true, TQStringList args = TQStringList()); /** * Add a module. @@ -135,9 +137,11 @@ public: * * @param withfallback Try harder to load the module. Might result * in the module appearing outside the dialog. + * + * @param args List of arguments to pass to the module. **/ void addModule(const KCModuleInfo& moduleinfo, TQStringList - parentmodulenames = TQStringList(), bool withfallback=false); + parentmodulenames = TQStringList(), bool withfallback=false, TQStringList args = TQStringList()); /** * Remove all modules from the dialog. diff --git a/tdeprint/cups/ipprequest.cpp b/tdeprint/cups/ipprequest.cpp index 4bf899897..0fde06159 100644 --- a/tdeprint/cups/ipprequest.cpp +++ b/tdeprint/cups/ipprequest.cpp @@ -21,6 +21,7 @@ #include "cupsinfos.h" #include <stdlib.h> +#include <string> #include <cups/language.h> #include <kdebug.h> #include <kglobal.h> @@ -227,14 +228,19 @@ void IppRequest::addStringList_p(int group, int type, const TQString& name, cons { if (!name.isEmpty()) { - ipp_attribute_t *attr = ippAddStrings(request_,(ipp_tag_t)group,(ipp_tag_t)type,name.latin1(),(int)(values.count()),NULL,NULL); - int i(0); - for (TQStringList::ConstIterator it=values.begin(); it != values.end(); ++it, i++) -#ifdef HAVE_CUPS_1_6 - ippSetString(request_, &attr, i, strdup((*it).local8Bit())); -#else // HAVE_CUPS_1_6 - attr->values[i].string.text = strdup((*it).local8Bit()); -#endif // HAVE_CUPS_1_6 + //> Values buffer and references offset prepare + const char *vlsRefs[values.count()]; + std::string vlsBuf; + for(unsigned i_vl = 0; i_vl < values.count(); i_vl++) + { + vlsRefs[i_vl] = (const char*)vlsBuf.size(); + vlsBuf += values[i_vl].local8Bit(); + vlsBuf += (char)0; + } + //> References update to pointers + for(unsigned i_vl = 0; i_vl < values.count(); i_vl++) + vlsRefs[i_vl] = vlsBuf.data()+(intptr_t)vlsRefs[i_vl]; + ippAddStrings(request_,(ipp_tag_t)group,(ipp_tag_t)type,name.latin1(),(int)(values.count()),NULL,(const char**)&vlsRefs); } } |