Darrell Anderson 12 years ago
commit 01e9b41e1b

@ -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,

@ -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.

@ -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);
}
}

Loading…
Cancel
Save