diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-18 06:46:40 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-18 06:46:40 +0000 |
commit | 7c19562ad065b6729bac8eb9b40dfe0452a72272 (patch) | |
tree | 33325d1e02ecc9ca614c7209296f8f796a1c3478 /kipi-plugins/htmlexport | |
parent | a65baa328fac0a1ce12971fef8d998ce7bfbe237 (diff) | |
download | kipi-plugins-7c19562ad065b6729bac8eb9b40dfe0452a72272.tar.gz kipi-plugins-7c19562ad065b6729bac8eb9b40dfe0452a72272.zip |
TQt4 port kipi-plugins
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/libraries/kipi-plugins@1232561 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kipi-plugins/htmlexport')
26 files changed, 347 insertions, 344 deletions
diff --git a/kipi-plugins/htmlexport/THEME_HOWTO b/kipi-plugins/htmlexport/THEME_HOWTO index 689b9e5..b217e7e 100644 --- a/kipi-plugins/htmlexport/THEME_HOWTO +++ b/kipi-plugins/htmlexport/THEME_HOWTO @@ -39,7 +39,7 @@ It's a .ini-style file and looks like this: Url=http://example.com/themes/helloworld We use a desktop file format so that entries can be translated. If you look at -the desktop file for one of the themes shipped with the plugin, you will find +the desktop file for one of the themes shipped with the plugin, you will tqfind something like this: [Desktop Entry] @@ -78,7 +78,7 @@ Rename the desktop file accordingly: cd snow2 mv snow.desktop snow2.desktop -Edit "snow2.desktop": Remove all the `Name[...]` entries and replace `Name=Snow` +Edit "snow2.desktop": Remove all the `Name[...]` entries and tqreplace `Name=Snow` with `Name=Snow 2`. You are done, you can now open your favorite KIPI enabled application and start the diff --git a/kipi-plugins/htmlexport/abstractthemeparameter.cpp b/kipi-plugins/htmlexport/abstractthemeparameter.cpp index 7432ce8..2ba5e3f 100644 --- a/kipi-plugins/htmlexport/abstractthemeparameter.cpp +++ b/kipi-plugins/htmlexport/abstractthemeparameter.cpp @@ -30,9 +30,9 @@ static const char* DEFAULT_VALUE_KEY = "Default"; namespace KIPIHTMLExport { struct AbstractThemeParameter::Private { - QCString mInternalName; - QString mName; - QString mDefaultValue; + TQCString mInternalName; + TQString mName; + TQString mDefaultValue; }; AbstractThemeParameter::AbstractThemeParameter() { @@ -45,24 +45,24 @@ AbstractThemeParameter::~AbstractThemeParameter() { } -void AbstractThemeParameter::init(const QCString& internalName, const KConfigBase* configFile) { +void AbstractThemeParameter::init(const TQCString& internalName, const KConfigBase* configFile) { d->mInternalName = internalName; d->mName = configFile->readEntry(NAME_KEY); d->mDefaultValue = configFile->readEntry(DEFAULT_VALUE_KEY); } -QCString AbstractThemeParameter::internalName() const { +TQCString AbstractThemeParameter::internalName() const { return d->mInternalName; } -QString AbstractThemeParameter::name() const { +TQString AbstractThemeParameter::name() const { return d->mName; } -QString AbstractThemeParameter::defaultValue() const { +TQString AbstractThemeParameter::defaultValue() const { return d->mDefaultValue; } diff --git a/kipi-plugins/htmlexport/abstractthemeparameter.h b/kipi-plugins/htmlexport/abstractthemeparameter.h index 7c6393a..5127232 100644 --- a/kipi-plugins/htmlexport/abstractthemeparameter.h +++ b/kipi-plugins/htmlexport/abstractthemeparameter.h @@ -21,9 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA #ifndef ABSTRACTTHEMEPARAMETER_H #define ABSTRACTTHEMEPARAMETER_H -class QCString; -class QString; -class QWidget; +class TQCString; +class TQString; +class TQWidget; class KConfigBase; namespace KIPIHTMLExport { @@ -42,25 +42,25 @@ public: * Reads theme parameters from configFile. Initializes the internalName, * name and defaultValue fields. */ - virtual void init(const QCString& internalName, const KConfigBase* configFile); + virtual void init(const TQCString& internalName, const KConfigBase* configFile); - QCString internalName() const; + TQCString internalName() const; - QString name() const; + TQString name() const; - QString defaultValue() const; + TQString defaultValue() const; /** - * This method should return a QWidget representing the parameter, + * This method should return a TQWidget representing the parameter, * initialized with value. */ - virtual QWidget* createWidget(QWidget* parent, const QString& value) const = 0; + virtual TQWidget* createWidget(TQWidget* tqparent, const TQString& value) const = 0; /** * The opposite of createWidget: given a widget previously created with * createWidget, this method returns the current widget value. */ - virtual QString valueFromWidget(QWidget*) const = 0; + virtual TQString valueFromWidget(TQWidget*) const = 0; private: class Private; diff --git a/kipi-plugins/htmlexport/colorthemeparameter.cpp b/kipi-plugins/htmlexport/colorthemeparameter.cpp index c7905be..9df77e0 100644 --- a/kipi-plugins/htmlexport/colorthemeparameter.cpp +++ b/kipi-plugins/htmlexport/colorthemeparameter.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA // Self #include "colorthemeparameter.h" -// Qt +// TQt // KDE #include <kcolorbutton.h> @@ -31,15 +31,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA namespace KIPIHTMLExport { -QWidget* ColorThemeParameter::createWidget(QWidget* parent, const QString& value) const { - KColorButton* button = new KColorButton(parent); - QColor color(value); +TQWidget* ColorThemeParameter::createWidget(TQWidget* tqparent, const TQString& value) const { + KColorButton* button = new KColorButton(tqparent); + TQColor color(value); button->setColor(color); return button; } -QString ColorThemeParameter::valueFromWidget(QWidget* widget) const { +TQString ColorThemeParameter::valueFromWidget(TQWidget* widget) const { KColorButton* button = static_cast<KColorButton*>(widget); return button->color().name(); } diff --git a/kipi-plugins/htmlexport/colorthemeparameter.h b/kipi-plugins/htmlexport/colorthemeparameter.h index 6ba0577..5a62395 100644 --- a/kipi-plugins/htmlexport/colorthemeparameter.h +++ b/kipi-plugins/htmlexport/colorthemeparameter.h @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA #ifndef COLORTHEMEPARAMETER_H #define COLORTHEMEPARAMETER_H -// Qt +// TQt // KDE @@ -36,8 +36,8 @@ namespace KIPIHTMLExport { */ class ColorThemeParameter : public AbstractThemeParameter { public: - virtual QWidget* createWidget(QWidget* parent, const QString& value) const; - virtual QString valueFromWidget(QWidget*) const; + virtual TQWidget* createWidget(TQWidget* tqparent, const TQString& value) const; + virtual TQString valueFromWidget(TQWidget*) const; }; diff --git a/kipi-plugins/htmlexport/galleryinfo.cpp b/kipi-plugins/htmlexport/galleryinfo.cpp index 26c26a3..e529213 100644 --- a/kipi-plugins/htmlexport/galleryinfo.cpp +++ b/kipi-plugins/htmlexport/galleryinfo.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA // Self #include "galleryinfo.h" -// Qt +// TQt // KDE #include <kconfigbase.h> @@ -32,26 +32,26 @@ namespace KIPIHTMLExport { static const char* THEME_GROUP_PREFIX="Theme "; -QString GalleryInfo::getThemeParameterValue( - const QString& theme, - const QString& parameter, - const QString& defaultValue) const +TQString GalleryInfo::getThemeParameterValue( + const TQString& theme, + const TQString& parameter, + const TQString& defaultValue) const { - QString groupName = THEME_GROUP_PREFIX + theme; + TQString groupName = THEME_GROUP_PREFIX + theme; KConfigGroupSaver saver(config(), groupName); return config()->readEntry(parameter, defaultValue); } void GalleryInfo::setThemeParameterValue( - const QString& theme, - const QString& parameter, - const QString& value) + const TQString& theme, + const TQString& parameter, + const TQString& value) { // FIXME: This is hackish, but config() is const :'( KConfig* localConfig = const_cast<KConfig*>(config()); - QString groupName = THEME_GROUP_PREFIX + theme; + TQString groupName = THEME_GROUP_PREFIX + theme; KConfigGroupSaver saver(localConfig, groupName); return localConfig->writeEntry(parameter, value); } diff --git a/kipi-plugins/htmlexport/galleryinfo.h b/kipi-plugins/htmlexport/galleryinfo.h index f65e7bc..f4c4a4b 100644 --- a/kipi-plugins/htmlexport/galleryinfo.h +++ b/kipi-plugins/htmlexport/galleryinfo.h @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA #ifndef GALLERYINFO_H #define GALLERYINFO_H -// Qt -#include <qvaluelist.h> +// TQt +#include <tqvaluelist.h> // KDE #include <kurl.h> @@ -43,25 +43,25 @@ namespace KIPIHTMLExport { class GalleryInfo : public Config { public: /** - * Convenience method to get destURL as a KURL rather than a QString + * Convenience method to get destURL as a KURL rather than a TQString */ KURL destKURL() const { return KURL(destURL()); } - QString fullFormatString() const { + TQString fullFormatString() const { return getEnumString("fullFormat"); } - QString thumbnailFormatString() const { + TQString thumbnailFormatString() const { return getEnumString("thumbnailFormat"); } - QValueList<KIPI::ImageCollection> mCollectionList; + TQValueList<KIPI::ImageCollection> mCollectionList; - QString getThemeParameterValue(const QString& theme, const QString& parameter, const QString& defaultValue) const; + TQString getThemeParameterValue(const TQString& theme, const TQString& parameter, const TQString& defaultValue) const; - void setThemeParameterValue(const QString& theme, const QString& parameter, const QString& value); + void setThemeParameterValue(const TQString& theme, const TQString& parameter, const TQString& value); private: @@ -69,18 +69,18 @@ private: * KConfigXT enums are mapped to ints. * This method returns the string associated to the enum value. */ - QString getEnumString(const QString& itemName) const { + TQString getEnumString(const TQString& itemName) const { // findItem is not marked const :-( GalleryInfo* that=const_cast<GalleryInfo*>(this); KConfigSkeletonItem* tmp=that->findItem(itemName); KConfigSkeleton::ItemEnum* item=dynamic_cast<KConfigSkeleton::ItemEnum*>(tmp); Q_ASSERT(item); - if (!item) return QString::null; + if (!item) return TQString(); int value=item->value(); - QValueList<KConfigSkeleton::ItemEnum::Choice> lst=item->choices(); - QValueList<KConfigSkeleton::ItemEnum::Choice>::ConstIterator + TQValueList<KConfigSkeleton::ItemEnum::Choice> lst=item->choices(); + TQValueList<KConfigSkeleton::ItemEnum::Choice>::ConstIterator it=lst.begin(), end=lst.end(); for (int pos=0; it!=end; ++it, pos++) { @@ -88,7 +88,7 @@ private: return (*it).name; } } - return QString::null; + return TQString(); } }; diff --git a/kipi-plugins/htmlexport/generator.cpp b/kipi-plugins/htmlexport/generator.cpp index 4ae73a4..4844aa7 100644 --- a/kipi-plugins/htmlexport/generator.cpp +++ b/kipi-plugins/htmlexport/generator.cpp @@ -21,11 +21,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Self #include "generator.moc" -// Qt -#include <qdir.h> -#include <qfile.h> -#include <qpainter.h> -#include <qregexp.h> +// TQt +#include <tqdir.h> +#include <tqfile.h> +#include <tqpainter.h> +#include <tqregexp.h> // KDE #include <kaboutdata.h> @@ -56,17 +56,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace KIPIHTMLExport { -typedef QMap<QCString,QCString> XsltParameterMap; +typedef TQMap<TQCString,TQCString> XsltParameterMap; /** * Produce a web-friendly file name */ -QString webifyFileName(QString fileName) { +TQString webifyFileName(TQString fileName) { fileName=fileName.lower(); // Remove potentially troublesome chars - fileName=fileName.replace(QRegExp("[^-0-9a-z]+"), "_"); + fileName=fileName.tqreplace(TQRegExp("[^-0-9a-z]+"), "_"); return fileName; } @@ -77,11 +77,11 @@ QString webifyFileName(QString fileName) { */ class UniqueNameHelper { public: - QString makeNameUnique(QString name) { - QString nameBase = name; + TQString makeNameUnique(TQString name) { + TQString nameBase = name; int count=2; - while (mList.findIndex(name)!=-1) { - name = nameBase + QString::number(count); + while (mList.tqfindIndex(name)!=-1) { + name = nameBase + TQString::number(count); ++count; }; @@ -90,7 +90,7 @@ public: } private: - QStringList mList; + TQStringList mList; }; @@ -101,24 +101,24 @@ private: * a'bc => "a'bc" * a"'bc => concat('a"', "'", 'bc') */ -QCString makeXsltParam(const QString& txt) { - QString param; +TQCString makeXsltParam(const TQString& txt) { + TQString param; static const char apos='\''; static const char quote='"'; - if (txt.find(apos)==-1) { + if (txt.tqfind(apos)==-1) { // First or second case: no apos param= apos + txt + apos; - } else if (txt.find(quote)==-1) { + } else if (txt.tqfind(quote)==-1) { // Third case: only apos, no quote param= quote + txt + quote; } else { // Forth case: both apos and quote :-( - QStringList lst=QStringList::split(apos, txt, true /*allowEmptyEntries*/); + TQStringList lst=TQStringList::split(apos, txt, true /*allowEmptyEntries*/); - QStringList::Iterator it=lst.begin(), end=lst.end(); + TQStringList::Iterator it=lst.begin(), end=lst.end(); param= "concat("; param+= apos + *it + apos; ++it; @@ -136,14 +136,14 @@ QCString makeXsltParam(const QString& txt) { /** * Genearate a square thumbnail from @fullImage of @size x @size pixels */ -QImage generateSquareThumbnail(const QImage& fullImage, int size) { - QImage image = fullImage.smoothScale(size, size, QImage::ScaleMax); +TQImage generateSquareThumbnail(const TQImage& fullImage, int size) { + TQImage image = fullImage.smoothScale(size, size, TQ_ScaleMax); if (image.width() == size && image.height() == size) { return image; } - QPixmap croppedPix(size, size); - QPainter painter(&croppedPix); + TQPixmap croppedPix(size, size); + TQPainter painter(&croppedPix); int sx=0, sy=0; if (image.width()>size) { @@ -166,13 +166,13 @@ struct Generator::Private { // State info bool mWarnings; - QString mXMLFileName; + TQString mXMLFileName; UniqueNameHelper mUniqueNameHelper; bool init() { mTheme=Theme::findByInternalName(mInfo->theme()); if (!mTheme) { - logError( i18n("Could not find theme in '%1'").arg(mInfo->theme()) ); + logError( i18n("Could not find theme in '%1'").tqarg(mInfo->theme()) ); return false; } return true; @@ -186,7 +186,7 @@ struct Generator::Private { KURL destURL=mInfo->destKURL(); destURL.addPath(srcURL.filename()); - if (QFile::exists(destURL.path())) { + if (TQFile::exists(destURL.path())) { KIO::NetAccess::del(destURL, mProgressDialog); } bool ok=KIO::NetAccess::dircopy(srcURL, destURL, mProgressDialog); @@ -197,14 +197,14 @@ struct Generator::Private { return true; } - bool writeDataToFile(const QByteArray& data, const QString& destPath) { - QFile destFile(destPath); + bool writeDataToFile(const TQByteArray& data, const TQString& destPath) { + TQFile destFile(destPath); if (!destFile.open(IO_WriteOnly)) { - logWarning(i18n("Could not open file '%1' for writing").arg(destPath)); + logWarning(i18n("Could not open file '%1' for writing").tqarg(destPath)); return false; } - if (destFile.writeBlock(data) != (Q_LONG)data.size()) { - logWarning(i18n("Could not save image to file '%1'").arg(destPath)); + if (destFile.writeBlock(data) != (TQ_LONG)data.size()) { + logWarning(i18n("Could not save image to file '%1'").tqarg(destPath)); return false; } return true; @@ -213,7 +213,7 @@ struct Generator::Private { /** * Helper class for generateImageAndXMLForURL */ - void appendImageElementToXML(XMLWriter& xmlWriter, const QString& elementName, const QString& fileName, const QImage& image) { + void appendImageElementToXML(XMLWriter& xmlWriter, const TQString& elementName, const TQString& fileName, const TQImage& image) { XMLAttributeList attrList; attrList.append("fileName", fileName); attrList.append("width", image.width()); @@ -226,54 +226,54 @@ struct Generator::Private { * Generate images (full and thumbnail) for imageURL * Fills xmlWriter with info about this image */ - void generateImageAndXMLForURL(XMLWriter& xmlWriter, const QString& destDir, const KURL& imageURL) { + void generateImageAndXMLForURL(XMLWriter& xmlWriter, const TQString& destDir, const KURL& imageURL) { KIPI::ImageInfo info=mInterface->info(imageURL); // Load image - QString path=imageURL.path(); - QFile imageFile(path); + TQString path=imageURL.path(); + TQFile imageFile(path); if (!imageFile.open(IO_ReadOnly)) { - logWarning(i18n("Could not read image '%1'").arg(path)); + logWarning(i18n("Could not read image '%1'").tqarg(path)); return; } - QString imageFormat = QImageIO::imageFormat(&imageFile); + TQString imageFormat = TQImageIO::imageFormat(TQT_TQIODEVICE(&imageFile)); if (imageFormat.isEmpty()) { - logWarning(i18n("Format of image '%1' is unknown").arg(path)); + logWarning(i18n("Format of image '%1' is unknown").tqarg(path)); return; } imageFile.close(); imageFile.open(IO_ReadOnly); - QByteArray imageData = imageFile.readAll(); - QImage originalImage; + TQByteArray imageData = imageFile.readAll(); + TQImage originalImage; if (!originalImage.loadFromData(imageData) ) { - logWarning(i18n("Error loading image '%1'").arg(path)); + logWarning(i18n("Error loading image '%1'").tqarg(path)); return; } // Process images - QImage fullImage = originalImage; + TQImage fullImage = originalImage; if (!mInfo->useOriginalImageAsFullImage()) { if (mInfo->fullResize()) { int size = mInfo->fullSize(); - fullImage = fullImage.smoothScale(size, size, QImage::ScaleMin); + fullImage = fullImage.smoothScale(size, size, TQ_ScaleMin); } if (info.angle() != 0) { - QWMatrix matrix; + TQWMatrix matrix; matrix.rotate(info.angle()); fullImage = fullImage.xForm(matrix); } } - QImage thumbnail = generateSquareThumbnail(fullImage, mInfo->thumbnailSize()); + TQImage thumbnail = generateSquareThumbnail(fullImage, mInfo->thumbnailSize()); // Save images - QString baseFileName = webifyFileName(info.title()); + TQString baseFileName = webifyFileName(info.title()); baseFileName = mUniqueNameHelper.makeNameUnique(baseFileName); // Save full - QString fullFileName; + TQString fullFileName; if (mInfo->useOriginalImageAsFullImage()) { fullFileName = baseFileName + "." + imageFormat.lower(); if (!writeDataToFile(imageData, destDir + "/" + fullFileName)) { @@ -282,15 +282,15 @@ struct Generator::Private { } else { fullFileName = baseFileName + "." + mInfo->fullFormatString().lower(); - QString destPath = destDir + "/" + fullFileName; + TQString destPath = destDir + "/" + fullFileName; if (!fullImage.save(destPath, mInfo->fullFormatString().ascii(), mInfo->fullQuality())) { - logWarning(i18n("Could not save image '%1' to '%2'").arg(path).arg(destPath)); + logWarning(i18n("Could not save image '%1' to '%2'").tqarg(path).tqarg(destPath)); return; } } // Save original - QString originalFileName; + TQString originalFileName; if (mInfo->copyOriginalImage()) { originalFileName = "original_" + fullFileName; if (!writeDataToFile(imageData, destDir + "/" + originalFileName)) { @@ -299,10 +299,10 @@ struct Generator::Private { } // Save thumbnail - QString thumbnailFileName = "thumb_" + baseFileName + "." + mInfo->thumbnailFormatString().lower(); - QString destPath = destDir + "/" + thumbnailFileName; + TQString thumbnailFileName = "thumb_" + baseFileName + "." + mInfo->thumbnailFormatString().lower(); + TQString destPath = destDir + "/" + thumbnailFileName; if (!thumbnail.save(destPath, mInfo->thumbnailFormatString().ascii(), mInfo->thumbnailQuality())) { - logWarning(i18n("Could not save thumbnail for image '%1' to '%2'").arg(path).arg(destPath)); + logWarning(i18n("Could not save thumbnail for image '%1' to '%2'").tqarg(path).tqarg(destPath)); return; } @@ -320,7 +320,7 @@ struct Generator::Private { bool generateImagesAndXML() { - QString baseDestDir=mInfo->destKURL().path(); + TQString baseDestDir=mInfo->destKURL().path(); if (!createDir(baseDestDir)) return false; mXMLFileName=baseDestDir + "/gallery.xml"; @@ -333,14 +333,14 @@ struct Generator::Private { XMLElement collectionsX(xmlWriter, "collections"); // Loop on collections - QValueList<KIPI::ImageCollection>::Iterator collectionIt=mInfo->mCollectionList.begin(); - QValueList<KIPI::ImageCollection>::Iterator collectionEnd=mInfo->mCollectionList.end(); + TQValueList<KIPI::ImageCollection>::Iterator collectionIt=mInfo->mCollectionList.begin(); + TQValueList<KIPI::ImageCollection>::Iterator collectionEnd=mInfo->mCollectionList.end(); for (; collectionIt!=collectionEnd; ++collectionIt) { KIPI::ImageCollection collection=*collectionIt; - logInfo( i18n("Generating files for \"%1\"").arg(collection.name()) ); + logInfo( i18n("Generating files for \"%1\"").tqarg(collection.name()) ); - QString collectionFileName = webifyFileName(collection.name()); - QString destDir = baseDestDir + "/" + collectionFileName; + TQString collectionFileName = webifyFileName(collection.name()); + TQString destDir = baseDestDir + "/" + collectionFileName; if (!createDir(destDir)) return false; XMLElement collectionX(xmlWriter, "collection"); @@ -356,7 +356,7 @@ struct Generator::Private { int count = imageList.count(); for (; it!=end; ++it, ++pos) { mProgressDialog->setProgress(pos, count); - qApp->processEvents(); + tqApp->processEvents(); generateImageAndXMLForURL(xmlWriter, destDir, *it); } @@ -382,14 +382,14 @@ struct Generator::Private { */ void addThemeParameters(XsltParameterMap& map) { Theme::ParameterList parameterList = mTheme->parameterList(); - QString themeInternalName = mTheme->internalName(); + TQString themeInternalName = mTheme->internalName(); Theme::ParameterList::ConstIterator it = parameterList.begin(), end = parameterList.end(); for (; it!=end; ++it) { AbstractThemeParameter* themeParameter = *it; - QCString internalName = themeParameter->internalName(); - QString value = mInfo->getThemeParameterValue( + TQCString internalName = themeParameter->internalName(); + TQString value = mInfo->getThemeParameterValue( themeInternalName, internalName, themeParameter->defaultValue()); @@ -402,17 +402,17 @@ struct Generator::Private { bool generateHTML() { logInfo(i18n("Generating HTML files")); - QString xsltFileName=mTheme->directory() + "/template.xsl"; + TQString xsltFileName=mTheme->directory() + "/template.xsl"; CWrapper<xsltStylesheetPtr, xsltFreeStylesheet> xslt= xsltParseStylesheetFile( (const xmlChar*) xsltFileName.local8Bit().data() ); if (!xslt) { - logError(i18n("Could not load XSL file '%1'").arg(xsltFileName)); + logError(i18n("Could not load XSL file '%1'").tqarg(xsltFileName)); return false; } CWrapper<xmlDocPtr, xmlFreeDoc> xmlGallery=xmlParseFile( mXMLFileName.local8Bit().data() ); if (!xmlGallery) { - logError(i18n("Could not load XML file '%1'").arg(mXMLFileName)); + logError(i18n("Could not load XML file '%1'").tqarg(mXMLFileName)); return false; } @@ -435,12 +435,12 @@ struct Generator::Private { // Move to the destination dir, so that external documents get correctly // produced - QString oldCD=QDir::currentDirPath(); - QDir::setCurrent(mInfo->destKURL().path()); + TQString oldCD=TQDir::currentDirPath(); + TQDir::setCurrent(mInfo->destKURL().path()); CWrapper<xmlDocPtr, xmlFreeDoc> xmlOutput= xsltApplyStylesheet(xslt, xmlGallery, params); - QDir::setCurrent(oldCD); + TQDir::setCurrent(oldCD); //delete []params; if (!xmlOutput) { @@ -448,10 +448,10 @@ struct Generator::Private { return false; } - QString destFileName=mInfo->destKURL().path() + "/index.html"; + TQString destFileName=mInfo->destKURL().path() + "/index.html"; FILE* file=fopen(destFileName.local8Bit().data(), "w"); if (!file) { - logError(i18n("Could not open '%1' for writing").arg(destFileName)); + logError(i18n("Could not open '%1' for writing").tqarg(destFileName)); return false; } xsltSaveResultToFile(file, xmlOutput, xslt); @@ -461,15 +461,15 @@ struct Generator::Private { } - bool createDir(const QString& dirName) { - QStringList parts = QStringList::split('/', dirName); - QStringList::ConstIterator it = parts.begin(), end = parts.end(); - QDir dir = QDir::root(); + bool createDir(const TQString& dirName) { + TQStringList parts = TQStringList::split('/', dirName); + TQStringList::ConstIterator it = parts.begin(), end = parts.end(); + TQDir dir = TQDir::root(); for( ;it!=end; ++it) { - QString part = *it; + TQString part = *it; if (!dir.exists(part)) { if (!dir.mkdir(part)) { - logError(i18n("Could not create folder '%1' in '%2'").arg(part).arg(dir.absPath())); + logError(i18n("Could not create folder '%1' in '%2'").tqarg(part).tqarg(dir.absPath())); return false; } } @@ -479,22 +479,22 @@ struct Generator::Private { } - void logInfo(const QString& msg) { + void logInfo(const TQString& msg) { mProgressDialog->addedAction(msg, KIPI::ProgressMessage); } - void logError(const QString& msg) { + void logError(const TQString& msg) { mProgressDialog->addedAction(msg, KIPI::ErrorMessage); } - void logWarning(const QString& msg) { + void logWarning(const TQString& msg) { mProgressDialog->addedAction(msg, KIPI::WarningMessage); mWarnings=true; } }; Generator::Generator(KIPI::Interface* interface, GalleryInfo* info, KIPI::BatchProgressDialog* progressDialog) -: QObject() { +: TQObject() { d=new Private; d->mInterface=interface; d->mInfo=info; @@ -511,7 +511,7 @@ Generator::~Generator() { bool Generator::run() { if (!d->init()) return false; - QString destDir=d->mInfo->destKURL().path(); + TQString destDir=d->mInfo->destKURL().path(); if (!d->createDir(destDir)) return false; if (!d->copyTheme()) return false; diff --git a/kipi-plugins/htmlexport/generator.h b/kipi-plugins/htmlexport/generator.h index a85f99c..99ddd6f 100644 --- a/kipi-plugins/htmlexport/generator.h +++ b/kipi-plugins/htmlexport/generator.h @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef GENERATOR_H #define GENERATOR_H -#include <qobject.h> +#include <tqobject.h> namespace KIPI { class BatchProgressDialog; @@ -37,8 +37,9 @@ class GalleryInfo; * This class is responsible for generating the HTML and scaling the images * according to the settings specified by the user. */ -class Generator : public QObject { +class Generator : public TQObject { Q_OBJECT + TQ_OBJECT public: Generator(KIPI::Interface*, GalleryInfo*, KIPI::BatchProgressDialog*); ~Generator(); diff --git a/kipi-plugins/htmlexport/imagesettingspage.ui b/kipi-plugins/htmlexport/imagesettingspage.ui index e15009c..80278e4 100644 --- a/kipi-plugins/htmlexport/imagesettingspage.ui +++ b/kipi-plugins/htmlexport/imagesettingspage.ui @@ -1,10 +1,10 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>ImageSettingsPage</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ImageSettingsPage</cstring> </property> - <property name="geometry"> + <property name="tqgeometry"> <rect> <x>0</x> <y>0</y> @@ -22,7 +22,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLabel" row="0" column="0" rowspan="1" colspan="3"> + <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -45,7 +45,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>58</width> <height>20</height> @@ -62,7 +62,7 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>20</height> @@ -79,14 +79,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>104</height> </size> </property> </spacer> - <widget class="QLabel" row="3" column="0" rowspan="1" colspan="3"> + <widget class="TQLabel" row="3" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -109,7 +109,7 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>20</height> @@ -126,14 +126,14 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - <widget class="QButtonGroup" row="1" column="1" rowspan="1" colspan="2"> + <widget class="TQButtonGroup" row="1" column="1" rowspan="1" colspan="2"> <property name="name"> <cstring>kcfg_useOriginalImageAsFullImage</cstring> </property> @@ -150,7 +150,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QRadioButton" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQRadioButton" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>radioButton3</cstring> </property> @@ -161,7 +161,7 @@ <bool>true</bool> </property> </widget> - <widget class="QFrame" row="1" column="1"> + <widget class="TQFrame" row="1" column="1"> <property name="name"> <cstring>frame6</cstring> </property> @@ -178,7 +178,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QCheckBox" row="1" column="0"> + <widget class="TQCheckBox" row="1" column="0"> <property name="name"> <cstring>kcfg_fullResize</cstring> </property> @@ -189,7 +189,7 @@ <bool>true</bool> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel2_2_2_2</cstring> </property> @@ -200,7 +200,7 @@ <cstring>kcfg_fullFormat</cstring> </property> </widget> - <widget class="QSpinBox" row="0" column="4"> + <widget class="TQSpinBox" row="0" column="4"> <property name="name"> <cstring>kcfg_fullQuality</cstring> </property> @@ -208,7 +208,7 @@ <number>100</number> </property> </widget> - <widget class="QComboBox" row="0" column="1"> + <widget class="TQComboBox" row="0" column="1"> <item> <property name="text"> <string>JPEG</string> @@ -223,7 +223,7 @@ <cstring>kcfg_fullFormat</cstring> </property> </widget> - <widget class="QLabel" row="0" column="3"> + <widget class="TQLabel" row="0" column="3"> <property name="name"> <cstring>textLabel4</cstring> </property> @@ -244,14 +244,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - <widget class="QSpinBox" row="1" column="1"> + <widget class="TQSpinBox" row="1" column="1"> <property name="name"> <cstring>kcfg_fullSize</cstring> </property> @@ -265,7 +265,7 @@ <number>800</number> </property> </widget> - <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="5"> + <widget class="TQCheckBox" row="2" column="0" rowspan="1" colspan="5"> <property name="name"> <cstring>kcfg_copyOriginalImage</cstring> </property> @@ -288,7 +288,7 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>20</height> @@ -305,14 +305,14 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>19</height> </size> </property> </spacer> - <widget class="QRadioButton" row="3" column="0" rowspan="1" colspan="2"> + <widget class="TQRadioButton" row="3" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>radioButton4</cstring> </property> @@ -332,22 +332,22 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> - <widget class="QLayoutWidget" row="4" column="1" rowspan="1" colspan="2"> + <widget class="TQLayoutWidget" row="4" column="1" rowspan="1" colspan="2"> <property name="name"> - <cstring>layout13</cstring> + <cstring>tqlayout13</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QSpinBox" row="1" column="1"> + <widget class="TQSpinBox" row="1" column="1"> <property name="name"> <cstring>kcfg_thumbnailSize</cstring> </property> @@ -361,7 +361,7 @@ <number>160</number> </property> </widget> - <widget class="QSpinBox" row="0" column="4"> + <widget class="TQSpinBox" row="0" column="4"> <property name="name"> <cstring>kcfg_thumbnailQuality</cstring> </property> @@ -369,7 +369,7 @@ <number>100</number> </property> </widget> - <widget class="QLabel" row="0" column="3"> + <widget class="TQLabel" row="0" column="3"> <property name="name"> <cstring>textLabel4_2</cstring> </property> @@ -380,7 +380,7 @@ <cstring>kcfg_thumbnailQuality</cstring> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel2_2_2</cstring> </property> @@ -401,14 +401,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - <widget class="QComboBox" row="0" column="1"> + <widget class="TQComboBox" row="0" column="1"> <item> <property name="text"> <string>JPEG</string> @@ -423,7 +423,7 @@ <cstring>kcfg_thumbnailFormat</cstring> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel2_2</cstring> </property> @@ -452,5 +452,5 @@ <slot>setEnabled(bool)</slot> </connection> </connections> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/kipi-plugins/htmlexport/intthemeparameter.cpp b/kipi-plugins/htmlexport/intthemeparameter.cpp index 710f040..87472bd 100644 --- a/kipi-plugins/htmlexport/intthemeparameter.cpp +++ b/kipi-plugins/htmlexport/intthemeparameter.cpp @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA // Self #include "intthemeparameter.h" -// Qt -#include <qspinbox.h> +// TQt +#include <tqspinbox.h> // KDE #include <kconfigbase.h> @@ -51,7 +51,7 @@ IntThemeParameter::~IntThemeParameter() { } -void IntThemeParameter::init(const QCString& internalName, const KConfigBase* configFile) { +void IntThemeParameter::init(const TQCString& internalName, const KConfigBase* configFile) { AbstractThemeParameter::init(internalName, configFile); d->mMinValue = configFile->readNumEntry(MIN_VALUE_KEY, 0); @@ -59,8 +59,8 @@ void IntThemeParameter::init(const QCString& internalName, const KConfigBase* co } -QWidget* IntThemeParameter::createWidget(QWidget* parent, const QString& value) const { - QSpinBox* spinBox = new QSpinBox(parent); +TQWidget* IntThemeParameter::createWidget(TQWidget* tqparent, const TQString& value) const { + TQSpinBox* spinBox = new TQSpinBox(tqparent); spinBox->setValue(value.toInt()); spinBox->setMinValue(d->mMinValue); spinBox->setMaxValue(d->mMaxValue); @@ -68,9 +68,9 @@ QWidget* IntThemeParameter::createWidget(QWidget* parent, const QString& value) } -QString IntThemeParameter::valueFromWidget(QWidget* widget) const { - QSpinBox* spinBox = static_cast<QSpinBox*>(widget); - return QString::number(spinBox->value()); +TQString IntThemeParameter::valueFromWidget(TQWidget* widget) const { + TQSpinBox* spinBox = static_cast<TQSpinBox*>(widget); + return TQString::number(spinBox->value()); } diff --git a/kipi-plugins/htmlexport/intthemeparameter.h b/kipi-plugins/htmlexport/intthemeparameter.h index 4db06d1..802ccde 100644 --- a/kipi-plugins/htmlexport/intthemeparameter.h +++ b/kipi-plugins/htmlexport/intthemeparameter.h @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA #ifndef INTTHEMEPARAMETER_H #define INTTHEMEPARAMETER_H -// Qt +// TQt // KDE @@ -39,9 +39,9 @@ public: IntThemeParameter(); ~IntThemeParameter(); - virtual void init(const QCString& internalName, const KConfigBase* configFile); - virtual QWidget* createWidget(QWidget* parent, const QString& value) const; - virtual QString valueFromWidget(QWidget*) const; + virtual void init(const TQCString& internalName, const KConfigBase* configFile); + virtual TQWidget* createWidget(TQWidget* tqparent, const TQString& value) const; + virtual TQString valueFromWidget(TQWidget*) const; private: class Private; diff --git a/kipi-plugins/htmlexport/listthemeparameter.cpp b/kipi-plugins/htmlexport/listthemeparameter.cpp index 234f427..7a49b6d 100644 --- a/kipi-plugins/htmlexport/listthemeparameter.cpp +++ b/kipi-plugins/htmlexport/listthemeparameter.cpp @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA // Self #include "listthemeparameter.h" -// Qt -#include <qcombobox.h> +// TQt +#include <tqcombobox.h> // KDE #include <kconfigbase.h> @@ -33,8 +33,8 @@ static const char* ITEM_VALUE_KEY = "Value_"; static const char* ITEM_CAPTION_KEY = "Caption_"; struct ListThemeParameter::Private { - QStringList mOrderedValueList; - QMap<QString, QString> mContentMap; + TQStringList mOrderedValueList; + TQMap<TQString, TQString> mContentMap; }; ListThemeParameter::ListThemeParameter() { @@ -45,33 +45,33 @@ ListThemeParameter::~ListThemeParameter() { delete d; } -void ListThemeParameter::init(const QCString& internalName, const KConfigBase* configFile) { +void ListThemeParameter::init(const TQCString& internalName, const KConfigBase* configFile) { AbstractThemeParameter::init(internalName, configFile); for (int pos=0;; ++pos) { - QString valueKey = QString("%1%2").arg(ITEM_VALUE_KEY).arg(pos); - QString captionKey = QString("%1%2").arg(ITEM_CAPTION_KEY).arg(pos); + TQString valueKey = TQString("%1%2").tqarg(ITEM_VALUE_KEY).tqarg(pos); + TQString captionKey = TQString("%1%2").tqarg(ITEM_CAPTION_KEY).tqarg(pos); if (!configFile->hasKey(valueKey) || !configFile->hasKey(captionKey)) { break; } - QString value = configFile->readEntry(valueKey); - QString caption = configFile->readEntry(captionKey); + TQString value = configFile->readEntry(valueKey); + TQString caption = configFile->readEntry(captionKey); d->mOrderedValueList << value; d->mContentMap[value] = caption; } } -QWidget* ListThemeParameter::createWidget(QWidget* parent, const QString& widgetDefaultValue) const { - QComboBox* comboBox = new QComboBox(parent); +TQWidget* ListThemeParameter::createWidget(TQWidget* tqparent, const TQString& widgetDefaultValue) const { + TQComboBox* comboBox = new TQComboBox(tqparent); - QStringList::ConstIterator + TQStringList::ConstIterator it = d->mOrderedValueList.begin(), end = d->mOrderedValueList.end(); for (;it!=end; ++it) { - QString value = *it; - QString caption = d->mContentMap[value]; + TQString value = *it; + TQString caption = d->mContentMap[value]; comboBox->insertItem(caption); if (value == widgetDefaultValue) { comboBox->setCurrentItem(comboBox->count() - 1); @@ -81,9 +81,9 @@ QWidget* ListThemeParameter::createWidget(QWidget* parent, const QString& widget return comboBox; } -QString ListThemeParameter::valueFromWidget(QWidget* widget) const { +TQString ListThemeParameter::valueFromWidget(TQWidget* widget) const { Q_ASSERT(widget); - QComboBox* comboBox = static_cast<QComboBox*>(widget); + TQComboBox* comboBox = static_cast<TQComboBox*>(widget); return d->mOrderedValueList[comboBox->currentItem()]; } diff --git a/kipi-plugins/htmlexport/listthemeparameter.h b/kipi-plugins/htmlexport/listthemeparameter.h index 10c5939..eae31d8 100644 --- a/kipi-plugins/htmlexport/listthemeparameter.h +++ b/kipi-plugins/htmlexport/listthemeparameter.h @@ -35,9 +35,9 @@ public: ListThemeParameter(); ~ListThemeParameter(); - virtual void init(const QCString& internalName, const KConfigBase* configFile); - virtual QWidget* createWidget(QWidget* parent, const QString& value) const; - virtual QString valueFromWidget(QWidget*) const; + virtual void init(const TQCString& internalName, const KConfigBase* configFile); + virtual TQWidget* createWidget(TQWidget* tqparent, const TQString& value) const; + virtual TQString valueFromWidget(TQWidget*) const; private: struct Private; diff --git a/kipi-plugins/htmlexport/outputpage.ui b/kipi-plugins/htmlexport/outputpage.ui index 4c1f6f6..08944e7 100644 --- a/kipi-plugins/htmlexport/outputpage.ui +++ b/kipi-plugins/htmlexport/outputpage.ui @@ -1,10 +1,10 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>OutputPage</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>OutputPage</cstring> </property> - <property name="geometry"> + <property name="tqgeometry"> <rect> <x>0</x> <y>0</y> @@ -19,15 +19,15 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout1</cstring> + <cstring>tqlayout1</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -45,7 +45,7 @@ </widget> </hbox> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>kcfg_openInBrowser</cstring> </property> @@ -63,7 +63,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>51</height> @@ -74,7 +74,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kurlrequester.h</includehint> <includehint>klineedit.h</includehint> diff --git a/kipi-plugins/htmlexport/plugin.cpp b/kipi-plugins/htmlexport/plugin.cpp index 7b95aab..659e10f 100644 --- a/kipi-plugins/htmlexport/plugin.cpp +++ b/kipi-plugins/htmlexport/plugin.cpp @@ -49,8 +49,8 @@ struct Plugin::Private { }; -Plugin::Plugin(QObject *parent, const char*, const QStringList&) -: KIPI::Plugin(Factory::instance(), parent, "HTMLExport") +Plugin::Plugin(TQObject *tqparent, const char*, const TQStringList&) +: KIPI::Plugin(Factory::instance(), tqparent, "HTMLExport") { d=new Private; d->mAction=0; @@ -62,27 +62,27 @@ Plugin::~Plugin() { } -void Plugin::setup( QWidget* widget ) { +void Plugin::setup( TQWidget* widget ) { KIPI::Plugin::setup( widget ); d->mAction = new KAction(i18n("HTML Gallery..."), "www", 0, - this, SLOT(slotActivate()), + this, TQT_SLOT(slotActivate()), actionCollection(), "htmlexport"); addAction(d->mAction); } void Plugin::slotActivate() { - KIPI::Interface* interface = dynamic_cast< KIPI::Interface* >( parent() ); + KIPI::Interface* interface = dynamic_cast< KIPI::Interface* >( tqparent() ); Q_ASSERT(interface); GalleryInfo info; info.readConfig(); - QWidget* parent=KApplication::kApplication()->mainWidget(); - Wizard wizard(parent, interface, &info); - if (wizard.exec()==QDialog::Rejected) return; + TQWidget* tqparent=KApplication::kApplication()->mainWidget(); + Wizard wizard(tqparent, interface, &info); + if (wizard.exec()==TQDialog::Rejected) return; info.writeConfig(); - KIPI::BatchProgressDialog* progressDialog=new KIPI::BatchProgressDialog(parent, i18n("Generating gallery...")); + KIPI::BatchProgressDialog* progressDialog=new KIPI::BatchProgressDialog(tqparent, i18n("Generating gallery...")); Generator generator(interface, &info, progressDialog); progressDialog->show(); diff --git a/kipi-plugins/htmlexport/plugin.h b/kipi-plugins/htmlexport/plugin.h index 9327ea0..cab9e82 100644 --- a/kipi-plugins/htmlexport/plugin.h +++ b/kipi-plugins/htmlexport/plugin.h @@ -33,13 +33,14 @@ namespace KIPIHTMLExport { */ class Plugin : public KIPI::Plugin { Q_OBJECT + TQ_OBJECT public: - Plugin(QObject *parent, const char* name, const QStringList &args); + Plugin(TQObject *tqparent, const char* name, const TQStringList &args); virtual ~Plugin(); KIPI::Category category( KAction* action ) const; - virtual void setup( QWidget* widget ); + virtual void setup( TQWidget* widget ); private slots: void slotActivate(); diff --git a/kipi-plugins/htmlexport/stringthemeparameter.cpp b/kipi-plugins/htmlexport/stringthemeparameter.cpp index fb18fc4..8ad7f1c 100644 --- a/kipi-plugins/htmlexport/stringthemeparameter.cpp +++ b/kipi-plugins/htmlexport/stringthemeparameter.cpp @@ -21,24 +21,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA // Self #include "stringthemeparameter.h" -// Qt -#include <qlineedit.h> +// TQt +#include <tqlineedit.h> // KDE #include <kconfigbase.h> namespace KIPIHTMLExport { -QWidget* StringThemeParameter::createWidget(QWidget* parent, const QString& value) const { - QLineEdit* edit = new QLineEdit(parent); +TQWidget* StringThemeParameter::createWidget(TQWidget* tqparent, const TQString& value) const { + TQLineEdit* edit = new TQLineEdit(tqparent); edit->setText(value); return edit; } -QString StringThemeParameter::valueFromWidget(QWidget* widget) const { +TQString StringThemeParameter::valueFromWidget(TQWidget* widget) const { Q_ASSERT(widget); - QLineEdit* edit = static_cast<QLineEdit*>(widget); + TQLineEdit* edit = static_cast<TQLineEdit*>(widget); return edit->text(); } diff --git a/kipi-plugins/htmlexport/stringthemeparameter.h b/kipi-plugins/htmlexport/stringthemeparameter.h index 89d661a..26bbe6c 100644 --- a/kipi-plugins/htmlexport/stringthemeparameter.h +++ b/kipi-plugins/htmlexport/stringthemeparameter.h @@ -31,8 +31,8 @@ namespace KIPIHTMLExport { */ class StringThemeParameter : public AbstractThemeParameter { public: - virtual QWidget* createWidget(QWidget* parent, const QString& value) const; - virtual QString valueFromWidget(QWidget*) const; + virtual TQWidget* createWidget(TQWidget* tqparent, const TQString& value) const; + virtual TQString valueFromWidget(TQWidget*) const; }; } // namespace diff --git a/kipi-plugins/htmlexport/theme.cpp b/kipi-plugins/htmlexport/theme.cpp index ee70a9b..ebb4d97 100644 --- a/kipi-plugins/htmlexport/theme.cpp +++ b/kipi-plugins/htmlexport/theme.cpp @@ -22,9 +22,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA // Self #include "theme.h" -// Qt -#include <qfile.h> -#include <qtextstream.h> +// TQt +#include <tqfile.h> +#include <tqtextstream.h> // KDE #include <kdebug.h> @@ -62,18 +62,18 @@ struct Theme::Private { * Return the list of parameters defined in the desktop file. We need to * parse the file ourself to preserve parameter order. */ - QStringList readParameterNameList(const QString& desktopFileName) { - QStringList list; - QFile file(desktopFileName); + TQStringList readParameterNameList(const TQString& desktopFileName) { + TQStringList list; + TQFile file(desktopFileName); if (!file.open(IO_ReadOnly)) { - return QStringList(); + return TQStringList(); } - QTextStream stream(&file); - stream.setEncoding(QTextStream::UnicodeUTF8); - QString prefix = QString("[") + PARAMETER_GROUP_PREFIX; + TQTextStream stream(&file); + stream.setEncoding(TQTextStream::UnicodeUTF8); + TQString prefix = TQString("[") + PARAMETER_GROUP_PREFIX; while (!stream.atEnd()) { - QString line = stream.readLine(); + TQString line = stream.readLine(); line = line.stripWhiteSpace(); if (!line.startsWith(prefix)) { continue; @@ -90,22 +90,22 @@ struct Theme::Private { return list; } - void init(const QString& desktopFileName) { + void init(const TQString& desktopFileName) { mDesktopFile=new KDesktopFile(desktopFileName, true /*read only*/); mURL.setPath(desktopFileName); - QStringList parameterNameList = readParameterNameList(desktopFileName); + TQStringList parameterNameList = readParameterNameList(desktopFileName); readParameters(parameterNameList); } - void readParameters(const QStringList& list) { - QStringList::ConstIterator it=list.begin(), end=list.end(); + void readParameters(const TQStringList& list) { + TQStringList::ConstIterator it=list.begin(), end=list.end(); for (;it!=end; ++it) { - QString group = PARAMETER_GROUP_PREFIX + *it; - QCString internalName = (*it).utf8(); + TQString group = PARAMETER_GROUP_PREFIX + *it; + TQCString internalName = (*it).utf8(); KConfigGroupSaver saver(mDesktopFile, group); - QString type = mDesktopFile->readEntry(PARAMETER_TYPE_KEY); + TQString type = mDesktopFile->readEntry(PARAMETER_TYPE_KEY); AbstractThemeParameter* parameter; if (type == STRING_PARAMETER_TYPE) { parameter = new StringThemeParameter(); @@ -139,14 +139,14 @@ Theme::~Theme() { const Theme::List& Theme::getList() { if (sList.isEmpty()) { - QStringList internalNameList; - QStringList list=KGlobal::instance()->dirs()->findAllResources("data", "kipiplugin_htmlexport/themes/*/*.desktop"); - QStringList::Iterator it=list.begin(), end=list.end(); + TQStringList internalNameList; + TQStringList list=KGlobal::instance()->dirs()->findAllResources("data", "kipiplugin_htmlexport/themes/*/*.desktop"); + TQStringList::Iterator it=list.begin(), end=list.end(); for (;it!=end; ++it) { Theme* theme=new Theme; theme->d->init(*it); - QString internalName = theme->internalName(); - if (!internalNameList.contains(internalName)) { + TQString internalName = theme->internalName(); + if (!internalNameList.tqcontains(internalName)) { sList << Theme::Ptr(theme); internalNameList << internalName; } @@ -156,7 +156,7 @@ const Theme::List& Theme::getList() { } -Theme::Ptr Theme::findByInternalName(const QString& internalName) { +Theme::Ptr Theme::findByInternalName(const TQString& internalName) { const Theme::List& lst=getList(); Theme::List::ConstIterator it=lst.begin(), end=lst.end(); for (; it!=end; ++it) { @@ -169,35 +169,35 @@ Theme::Ptr Theme::findByInternalName(const QString& internalName) { } -QString Theme::internalName() const { +TQString Theme::internalName() const { KURL url = d->mURL; url.setFileName(""); return url.fileName(); } -QString Theme::name() const { +TQString Theme::name() const { return d->mDesktopFile->readName(); } -QString Theme::comment() const { +TQString Theme::comment() const { return d->mDesktopFile->readComment(); } -QString Theme::directory() const { +TQString Theme::directory() const { return d->mURL.directory(); } -QString Theme::authorName() const { +TQString Theme::authorName() const { KConfigGroupSaver saver(d->mDesktopFile, AUTHOR_GROUP); return d->mDesktopFile->readEntry("Name"); } -QString Theme::authorUrl() const { +TQString Theme::authorUrl() const { KConfigGroupSaver saver(d->mDesktopFile, AUTHOR_GROUP); return d->mDesktopFile->readEntry("Url"); } diff --git a/kipi-plugins/htmlexport/theme.h b/kipi-plugins/htmlexport/theme.h index 438bc47..0619097 100644 --- a/kipi-plugins/htmlexport/theme.h +++ b/kipi-plugins/htmlexport/theme.h @@ -21,9 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA #ifndef THEME_H #define THEME_H -// Qt -#include <qstring.h> -#include <qvaluelist.h> +// TQt +#include <tqstring.h> +#include <tqvaluelist.h> // KDE #include <ksharedptr.h> @@ -40,24 +40,24 @@ class AbstractThemeParameter; class Theme : public KShared { public: typedef KSharedPtr<Theme> Ptr; - typedef QValueList<Ptr> List; - typedef QValueList<AbstractThemeParameter*> ParameterList; + typedef TQValueList<Ptr> List; + typedef TQValueList<AbstractThemeParameter*> ParameterList; ~Theme(); /** * Internal theme name == name of theme folder */ - QString internalName() const; - QString name() const; - QString comment() const; + TQString internalName() const; + TQString name() const; + TQString comment() const; - QString authorName() const; - QString authorUrl() const; + TQString authorName() const; + TQString authorUrl() const; /** * Theme directory on hard disk */ - QString directory() const; + TQString directory() const; ParameterList parameterList() const; @@ -65,7 +65,7 @@ public: * Returns the list of available themes */ static const List& getList(); - static Ptr findByInternalName(const QString& internalName); + static Ptr findByInternalName(const TQString& internalName); private: Theme(); diff --git a/kipi-plugins/htmlexport/themepage.ui b/kipi-plugins/htmlexport/themepage.ui index 635443c..80eb559 100644 --- a/kipi-plugins/htmlexport/themepage.ui +++ b/kipi-plugins/htmlexport/themepage.ui @@ -1,10 +1,10 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>ThemePage</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ThemePage</cstring> </property> - <property name="geometry"> + <property name="tqgeometry"> <rect> <x>0</x> <y>0</y> @@ -33,7 +33,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klistbox.h</includehint> <includehint>ktextbrowser.h</includehint> diff --git a/kipi-plugins/htmlexport/themeparameterspage.ui b/kipi-plugins/htmlexport/themeparameterspage.ui index 0c0fc73..e50469c 100644 --- a/kipi-plugins/htmlexport/themeparameterspage.ui +++ b/kipi-plugins/htmlexport/themeparameterspage.ui @@ -1,10 +1,10 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>ThemeParametersPage</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ThemeParametersPage</cstring> </property> - <property name="geometry"> + <property name="tqgeometry"> <rect> <x>0</x> <y>0</y> @@ -22,7 +22,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -37,7 +37,7 @@ <property name="text"> <string>In this page, you can change some theme parameters. Depending on the theme, different parameters are available.</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>WordBreak|AlignVCenter</set> </property> </widget> @@ -51,14 +51,14 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>20</height> </size> </property> </spacer> - <widget class="QFrame" row="2" column="1"> + <widget class="TQFrame" row="2" column="1"> <property name="name"> <cstring>content</cstring> </property> @@ -79,7 +79,7 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>16</height> @@ -88,5 +88,5 @@ </spacer> </grid> </widget> -<layoutdefaults spacing="6" margin="0"/> +<tqlayoutdefaults spacing="6" margin="0"/> </UI> diff --git a/kipi-plugins/htmlexport/wizard.cpp b/kipi-plugins/htmlexport/wizard.cpp index 3f8660b..6833f4c 100644 --- a/kipi-plugins/htmlexport/wizard.cpp +++ b/kipi-plugins/htmlexport/wizard.cpp @@ -21,16 +21,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA // Self #include "wizard.moc" -// Qt -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qdir.h> -#include <qfileinfo.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qobjectlist.h> -#include <qpainter.h> -#include <qspinbox.h> +// TQt +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqdir.h> +#include <tqfileinfo.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqobjectlist.h> +#include <tqpainter.h> +#include <tqspinbox.h> // KDE #include <kconfigdialogmanager.h> @@ -63,10 +63,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA namespace KIPIHTMLExport { -class ThemeListBoxItem : public QListBoxText { +class ThemeListBoxItem : public TQListBoxText { public: - ThemeListBoxItem(QListBox* list, Theme::Ptr theme) - : QListBoxText(list, theme->name()) + ThemeListBoxItem(TQListBox* list, Theme::Ptr theme) + : TQListBoxText(list, theme->name()) , mTheme(theme) {} @@ -84,7 +84,7 @@ struct Wizard::Private { ImageSettingsPage* mImageSettingsPage; OutputPage* mOutputPage; KIPIPlugins::KPAboutData* mAbout; - QMap<QCString, QWidget*> mThemeParameterWidgetFromName; + TQMap<TQCString, TQWidget*> mThemeParameterWidgetFromName; void initThemePage() { KListBox* listBox=mThemePage->mThemeList; @@ -101,72 +101,72 @@ struct Wizard::Private { void fillThemeParametersPage(Theme::Ptr theme) { // Delete any previous widgets - QFrame* content = mThemeParametersPage->content; - if (content->layout()) { + TQFrame* content = mThemeParametersPage->content; + if (content->tqlayout()) { // Setting recursiveSearch to false is very important, if we don't // we will end up deleting subwidgets of our child widgets - QObjectList* list = content->queryList("QWidget", 0 /*objName*/, + TQObjectList* list = content->queryList(TQWIDGET_OBJECT_NAME_STRING, 0 /*objName*/, false /*regexpMatch*/, false /*recursiveSearch*/); - QObjectListIterator it(*list); + TQObjectListIterator it(*list); for( ; it.current(); ++it) { delete it.current(); } - delete content->layout(); + delete content->tqlayout(); } mThemeParameterWidgetFromName.clear(); - // Create layout. We need to recreate it everytime, to get rid of + // Create tqlayout. We need to recreate it everytime, to get rid of // spacers - QGridLayout* layout = new QGridLayout(content, 0, 3); - layout->setSpacing(KDialog::spacingHint()); + TQGridLayout* tqlayout = new TQGridLayout(content, 0, 3); + tqlayout->setSpacing(KDialog::spacingHint()); // Create widgets Theme::ParameterList parameterList = theme->parameterList(); - QString themeInternalName = theme->internalName(); + TQString themeInternalName = theme->internalName(); Theme::ParameterList::ConstIterator it = parameterList.begin(), end = parameterList.end(); for (; it!=end; ++it) { AbstractThemeParameter* themeParameter = *it; - QCString internalName = themeParameter->internalName(); - QString value = mInfo->getThemeParameterValue( + TQCString internalName = themeParameter->internalName(); + TQString value = mInfo->getThemeParameterValue( themeInternalName, internalName, themeParameter->defaultValue()); - QString name = themeParameter->name(); - name = i18n("'%1' is a label for a theme parameter", "%1:").arg(name); + TQString name = themeParameter->name(); + name = i18n("'%1' is a label for a theme parameter", "%1:").tqarg(name); - QLabel* label = new QLabel(name, content); - QWidget* widget = themeParameter->createWidget(content, value); + TQLabel* label = new TQLabel(name, content); + TQWidget* widget = themeParameter->createWidget(content, value); label->setBuddy(widget); - int row = layout->numRows(); - layout->addWidget(label, row, 0); + int row = tqlayout->numRows(); + tqlayout->addWidget(label, row, 0); - if (widget->sizePolicy().expanding() & QSizePolicy::Horizontally) { + if (widget->tqsizePolicy().expanding() & TQSizePolicy::Horizontally) { // Widget wants full width - layout->addMultiCellWidget(widget, row, row, 1, 2); + tqlayout->addMultiCellWidget(widget, row, row, 1, 2); } else { // Widget doesn't like to be stretched, add a spacer next to it - layout->addWidget(widget, row, 1); - QSpacerItem* spacer = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum); - layout->addItem(spacer, row, 2); + tqlayout->addWidget(widget, row, 1); + TQSpacerItem* spacer = new TQSpacerItem(1, 1, TQSizePolicy::Expanding, TQSizePolicy::Minimum); + tqlayout->addItem(spacer, row, 2); } mThemeParameterWidgetFromName[internalName] = widget; } // Add spacer at the end, so that widgets aren't spread on the whole - // parent height - QSpacerItem* spacer = new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding); - layout->addItem(spacer, layout->numRows(), 0); + // tqparent height + TQSpacerItem* spacer = new TQSpacerItem(1, 1, TQSizePolicy::Minimum, TQSizePolicy::Expanding); + tqlayout->addItem(spacer, tqlayout->numRows(), 0); } }; -Wizard::Wizard(QWidget* parent, KIPI::Interface* interface, GalleryInfo* info) -: KWizard(parent) +Wizard::Wizard(TQWidget* tqparent, KIPI::Interface* interface, GalleryInfo* info) +: KWizard(tqparent) { d=new Private; d->mInfo=info; @@ -184,7 +184,7 @@ Wizard::Wizard(QWidget* parent, KIPI::Interface* interface, GalleryInfo* info) // Help button KHelpMenu* helpMenu = new KHelpMenu(this, d->mAbout, false); helpMenu->menu()->removeItemAt(0); - helpMenu->menu()->insertItem(i18n("Plugin Handbook"), this, SLOT(showHelp()), 0, -1, 0); + helpMenu->menu()->insertItem(i18n("Plugin Handbook"), this, TQT_SLOT(showHelp()), 0, -1, 0); helpButton()->setPopup( helpMenu->menu() ); d->mCollectionSelector=new KIPI::ImageCollectionSelector(this, interface); @@ -193,8 +193,8 @@ Wizard::Wizard(QWidget* parent, KIPI::Interface* interface, GalleryInfo* info) d->mThemePage=new ThemePage(this); d->initThemePage(); addPage(d->mThemePage, i18n("Theme")); - connect(d->mThemePage->mThemeList, SIGNAL(selectionChanged()), - this, SLOT(slotThemeSelectionChanged()) ); + connect(d->mThemePage->mThemeList, TQT_SIGNAL(selectionChanged()), + this, TQT_SLOT(slotThemeSelectionChanged()) ); d->mThemeParametersPage = new ThemeParametersPage(this); addPage(d->mThemeParametersPage, i18n("Theme Parameters")); @@ -206,8 +206,8 @@ Wizard::Wizard(QWidget* parent, KIPI::Interface* interface, GalleryInfo* info) d->mOutputPage->kcfg_destURL->setMode(KFile::Directory); addPage(d->mOutputPage, i18n("Output")); - connect(d->mOutputPage->kcfg_destURL, SIGNAL(textChanged(const QString&)), - this, SLOT(updateFinishButton()) ); + connect(d->mOutputPage->kcfg_destURL, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(updateFinishButton()) ); d->mConfigManager=new KConfigDialogManager(this, d->mInfo); d->mConfigManager->updateWidgets(); @@ -239,15 +239,15 @@ void Wizard::slotThemeSelectionChanged() { if (listBox->selectedItem()) { Theme::Ptr theme=static_cast<ThemeListBoxItem*>(listBox->selectedItem())->mTheme; - QString url=theme->authorUrl(); - QString author=theme->authorName(); + TQString url=theme->authorUrl(); + TQString author=theme->authorName(); if (!url.isEmpty()) { - author=QString("<a href='%1'>%2</a>").arg(url).arg(author); + author=TQString("<a href='%1'>%2</a>").tqarg(url).tqarg(author); } - QString txt= - QString("<b>%1</b><br><br>%2<br><br>").arg(theme->name(), theme->comment()) - + i18n("Author: %1").arg(author); + TQString txt= + TQString("<b>%1</b><br><br>%2<br><br>").tqarg(theme->name(), theme->comment()) + + i18n("Author: %1").tqarg(author); browser->setText(txt); setNextEnabled(d->mThemePage, true); @@ -270,7 +270,7 @@ void Wizard::accept() { d->mInfo->mCollectionList=d->mCollectionSelector->selectedImageCollections(); Theme::Ptr theme=static_cast<ThemeListBoxItem*>(d->mThemePage->mThemeList->selectedItem())->mTheme; - QString themeInternalName = theme->internalName(); + TQString themeInternalName = theme->internalName(); d->mInfo->setTheme(themeInternalName); Theme::ParameterList parameterList = theme->parameterList(); @@ -279,9 +279,9 @@ void Wizard::accept() { end = parameterList.end(); for (; it!=end; ++it) { AbstractThemeParameter* themeParameter = *it; - QCString parameterInternalName = themeParameter->internalName(); - QWidget* widget = d->mThemeParameterWidgetFromName[parameterInternalName]; - QString value = themeParameter->valueFromWidget(widget); + TQCString parameterInternalName = themeParameter->internalName(); + TQWidget* widget = d->mThemeParameterWidgetFromName[parameterInternalName]; + TQString value = themeParameter->valueFromWidget(widget); d->mInfo->setThemeParameterValue( themeInternalName, diff --git a/kipi-plugins/htmlexport/wizard.h b/kipi-plugins/htmlexport/wizard.h index 23749ad..d7e0bbd 100644 --- a/kipi-plugins/htmlexport/wizard.h +++ b/kipi-plugins/htmlexport/wizard.h @@ -37,8 +37,9 @@ class GalleryInfo; */ class Wizard : public KWizard { Q_OBJECT + TQ_OBJECT public: - Wizard(QWidget* parent, KIPI::Interface* interface, GalleryInfo* info); + Wizard(TQWidget* tqparent, KIPI::Interface* interface, GalleryInfo* info); ~Wizard(); protected slots: diff --git a/kipi-plugins/htmlexport/xmlutils.h b/kipi-plugins/htmlexport/xmlutils.h index baca26a..8f066ae 100644 --- a/kipi-plugins/htmlexport/xmlutils.h +++ b/kipi-plugins/htmlexport/xmlutils.h @@ -66,7 +66,7 @@ private: */ class XMLWriter { public: - bool open(const QString& name) { + bool open(const TQString& name) { xmlTextWriterPtr ptr=xmlNewTextWriterFilename(name.local8Bit(), 0); if (!ptr) return false; mWriter.assign(ptr); @@ -86,12 +86,12 @@ public: return mWriter; } - void writeElement(const char* element, const QString& value) { + void writeElement(const char* element, const TQString& value) { xmlTextWriterWriteElement(mWriter, BAD_CAST element, BAD_CAST value.utf8().data()); } void writeElement(const char* element, int value) { - writeElement(element, QString::number(value)); + writeElement(element, TQString::number(value)); } private: @@ -103,7 +103,7 @@ private: * A list of attributes for an XML element. To be used with @ref XMLElement */ class XMLAttributeList { - typedef QMap<QString, QString> Map; + typedef TQMap<TQString, TQString> Map; public: void write(XMLWriter& writer) const { Map::const_iterator it=mMap.begin(); @@ -115,12 +115,12 @@ public: } } - void append(const QString& key, const QString& value) { + void append(const TQString& key, const TQString& value) { mMap[key]=value; } - void append(const QString& key, int value) { - mMap[key]=QString::number(value); + void append(const TQString& key, int value) { + mMap[key]=TQString::number(value); } private: @@ -133,7 +133,7 @@ private: */ class XMLElement { public: - XMLElement(XMLWriter& writer, const QString& element, const XMLAttributeList* attributeList=0) + XMLElement(XMLWriter& writer, const TQString& element, const XMLAttributeList* attributeList=0) : mWriter(writer) { xmlTextWriterStartElement(writer, BAD_CAST element.ascii()); |