diff options
Diffstat (limited to 'konq-plugins/kimgalleryplugin')
-rw-r--r-- | konq-plugins/kimgalleryplugin/imgallerydialog.cpp | 166 | ||||
-rw-r--r-- | konq-plugins/kimgalleryplugin/imgallerydialog.h | 54 | ||||
-rw-r--r-- | konq-plugins/kimgalleryplugin/imgalleryplugin.cpp | 160 | ||||
-rw-r--r-- | konq-plugins/kimgalleryplugin/imgalleryplugin.h | 24 |
4 files changed, 202 insertions, 202 deletions
diff --git a/konq-plugins/kimgalleryplugin/imgallerydialog.cpp b/konq-plugins/kimgalleryplugin/imgallerydialog.cpp index 54db458..87e2e31 100644 --- a/konq-plugins/kimgalleryplugin/imgallerydialog.cpp +++ b/konq-plugins/kimgalleryplugin/imgallerydialog.cpp @@ -18,15 +18,15 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qlabel.h> -#include <qvbox.h> -#include <qgroupbox.h> -#include <qlayout.h> -#include <qcombobox.h> -#include <qwhatsthis.h> -#include <qcheckbox.h> -#include <qlineedit.h> -#include <qspinbox.h> +#include <tqlabel.h> +#include <tqvbox.h> +#include <tqgroupbox.h> +#include <tqlayout.h> +#include <tqcombobox.h> +#include <tqwhatsthis.h> +#include <tqcheckbox.h> +#include <tqlineedit.h> +#include <tqspinbox.h> #include <klocale.h> @@ -44,7 +44,7 @@ Boston, MA 02110-1301, USA. #include "imgallerydialog.h" #include "imgallerydialog.moc" -KIGPDialog::KIGPDialog(QWidget *parent, const QString& path, const char *name ) +KIGPDialog::KIGPDialog(TQWidget *parent, const TQString& path, const char *name ) : KDialogBase( IconList, i18n("Configure"), Default|Ok|Cancel, Ok, parent, name, true, true ), m_dialogOk( false ) @@ -67,8 +67,8 @@ void KIGPDialog::slotDefault() m_imageProperty->setChecked(false); m_fontName->setCurrentText( KGlobalSettings::generalFont().family() ); m_fontSize->setValue(14); - m_foregroundColor->setColor( QColor( "#d0ffd0") ); - m_backgroundColor->setColor( QColor("#333333") ); + m_foregroundColor->setColor( TQColor( "#d0ffd0") ); + m_backgroundColor->setColor( TQColor("#333333") ); m_imageNameReq->setURL(m_path + "images.html"); m_recurseSubDir->setChecked( false ); @@ -84,19 +84,19 @@ void KIGPDialog::slotDefault() m_colorDepth->setCurrentText("8"); } -void KIGPDialog::setupLookPage(const QString& path) { - QFrame *page = addPage( i18n("Look"), i18n("Page Look"), +void KIGPDialog::setupLookPage(const TQString& path) { + TQFrame *page = addPage( i18n("Look"), i18n("Page Look"), BarIcon("colorize", KIcon::SizeMedium ) ); m_config->setGroup("Look"); - QVBoxLayout *vlay = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *vlay = new TQVBoxLayout( page, 0, spacingHint() ); - QLabel *label; + TQLabel *label; - label = new QLabel( i18n("&Page title:"), page); + label = new TQLabel( i18n("&Page title:"), page); vlay->addWidget(label); - m_title = new QLineEdit(i18n("Image Gallery for %1").arg(path), page); + m_title = new TQLineEdit(i18n("Image Gallery for %1").arg(path), page); vlay->addWidget( m_title ); label->setBuddy(m_title); @@ -105,67 +105,67 @@ void KIGPDialog::setupLookPage(const QString& path) { m_imagesPerRow->setLabel( i18n("I&mages per row:") ); vlay->addWidget( m_imagesPerRow ); - QGridLayout *grid = new QGridLayout( 2, 2 ); + TQGridLayout *grid = new TQGridLayout( 2, 2 ); vlay->addLayout( grid ); - m_imageName = new QCheckBox( i18n("Show image file &name"), page); + m_imageName = new TQCheckBox( i18n("Show image file &name"), page); m_imageName->setChecked( m_config->readBoolEntry("ImageName", true) ); grid->addWidget( m_imageName, 0, 0 ); - m_imageSize = new QCheckBox( i18n("Show image file &size"), page); + m_imageSize = new TQCheckBox( i18n("Show image file &size"), page); m_imageSize->setChecked( m_config->readBoolEntry("ImageSize", false) ); grid->addWidget( m_imageSize, 0, 1 ); - m_imageProperty = new QCheckBox( i18n("Show image &dimensions"), page); + m_imageProperty = new TQCheckBox( i18n("Show image &dimensions"), page); m_imageProperty->setChecked( m_config->readBoolEntry("ImageProperty", false) ); grid->addWidget( m_imageProperty, 1, 0 ); - QHBoxLayout *hlay11 = new QHBoxLayout( ); + TQHBoxLayout *hlay11 = new TQHBoxLayout( ); vlay->addLayout( hlay11 ); - m_fontName = new QComboBox( false,page ); - QStringList standardFonts; + m_fontName = new TQComboBox( false,page ); + TQStringList standardFonts; KFontChooser::getFontList(standardFonts, 0); m_fontName->insertStringList( standardFonts ); m_fontName->setCurrentText( m_config->readEntry("FontName", KGlobalSettings::generalFont().family() ) ); - label = new QLabel( i18n("Fon&t name:"), page ); + label = new TQLabel( i18n("Fon&t name:"), page ); label->setBuddy( m_fontName ); hlay11->addWidget( label ); hlay11->addStretch( 1 ); hlay11->addWidget( m_fontName ); - QHBoxLayout *hlay12 = new QHBoxLayout( ); + TQHBoxLayout *hlay12 = new TQHBoxLayout( ); vlay->addLayout( hlay12 ); - m_fontSize = new QSpinBox( 6, 15, 1, page ); + m_fontSize = new TQSpinBox( 6, 15, 1, page ); m_fontSize->setValue( m_config->readNumEntry("FontSize", 14) ); - label = new QLabel( i18n("Font si&ze:"), page ); + label = new TQLabel( i18n("Font si&ze:"), page ); label->setBuddy( m_fontSize ); hlay12->addWidget( label ); hlay12->addStretch( 1 ); hlay12->addWidget( m_fontSize ); - QHBoxLayout *hlay1 = new QHBoxLayout( spacingHint() ); + TQHBoxLayout *hlay1 = new TQHBoxLayout( spacingHint() ); vlay->addLayout( hlay1 ); m_foregroundColor = new KColorButton(page); - m_foregroundColor->setColor( QColor( m_config->readEntry("ForegroundColor", "#d0ffd0") ) ); + m_foregroundColor->setColor( TQColor( m_config->readEntry("ForegroundColor", "#d0ffd0") ) ); - label = new QLabel( i18n("&Foreground color:"), page); + label = new TQLabel( i18n("&Foreground color:"), page); label->setBuddy( m_foregroundColor ); hlay1->addWidget( label ); hlay1->addStretch( 1 ); hlay1->addWidget(m_foregroundColor); - QHBoxLayout *hlay2 = new QHBoxLayout( spacingHint() ); + TQHBoxLayout *hlay2 = new TQHBoxLayout( spacingHint() ); vlay->addLayout( hlay2 ); m_backgroundColor = new KColorButton(page); - m_backgroundColor->setColor( QColor(m_config->readEntry("BackgroundColor", "#333333") ) ); + m_backgroundColor->setColor( TQColor(m_config->readEntry("BackgroundColor", "#333333") ) ); - label = new QLabel( i18n("&Background color:"), page); + label = new TQLabel( i18n("&Background color:"), page); hlay2->addWidget( label ); label->setBuddy( m_backgroundColor ); hlay2->addStretch( 1 ); @@ -174,33 +174,33 @@ void KIGPDialog::setupLookPage(const QString& path) { vlay->addStretch(1); } -void KIGPDialog::setupDirectoryPage(const QString& path) { - QFrame *page = addPage( i18n("Folders"), i18n("Folders"), +void KIGPDialog::setupDirectoryPage(const TQString& path) { + TQFrame *page = addPage( i18n("Folders"), i18n("Folders"), BarIcon("folder", KIcon::SizeMedium ) ); m_config->setGroup("Directory"); - QVBoxLayout *dvlay = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *dvlay = new TQVBoxLayout( page, 0, spacingHint() ); - QLabel *label; - label = new QLabel(i18n("&Save to HTML file:"), page); + TQLabel *label; + label = new TQLabel(i18n("&Save to HTML file:"), page); dvlay->addWidget( label ); - QString whatsThis; + TQString whatsThis; whatsThis = i18n("<p>The name of the HTML file this gallery will be saved to."); - QWhatsThis::add( label, whatsThis ); + TQWhatsThis::add( label, whatsThis ); m_imageNameReq = new KURLRequester(path + "images.html", page); label->setBuddy( m_imageNameReq ); dvlay->addWidget(m_imageNameReq); - connect( m_imageNameReq, SIGNAL(textChanged(const QString&)), - this, SLOT(imageUrlChanged(const QString&)) ); - QWhatsThis::add( m_imageNameReq, whatsThis ); + connect( m_imageNameReq, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(imageUrlChanged(const TQString&)) ); + TQWhatsThis::add( m_imageNameReq, whatsThis ); const bool recurseSubDir = m_config->readBoolEntry("RecurseSubDirectories", false); - m_recurseSubDir = new QCheckBox(i18n("&Recurse subfolders"), page); + m_recurseSubDir = new TQCheckBox(i18n("&Recurse subfolders"), page); m_recurseSubDir->setChecked( recurseSubDir ); whatsThis = i18n("<p>Whether subfolders should be included for the " "image gallery creation or not."); - QWhatsThis::add( m_recurseSubDir, whatsThis ); + TQWhatsThis::add( m_recurseSubDir, whatsThis ); const int recursionLevel = m_config->readNumEntry("RecursionLevel", 0); m_recursionLevel = new KIntNumInput( recursionLevel, page ); @@ -212,25 +212,25 @@ void KIGPDialog::setupDirectoryPage(const QString& path) { whatsThis = i18n("<p>You can limit the number of folders the " "image gallery creator will traverse to by setting an " "upper bound for the recursion depth."); - QWhatsThis::add( m_recursionLevel, whatsThis ); + TQWhatsThis::add( m_recursionLevel, whatsThis ); - connect(m_recurseSubDir, SIGNAL( toggled(bool) ), - m_recursionLevel, SLOT( setEnabled(bool) ) ); + connect(m_recurseSubDir, TQT_SIGNAL( toggled(bool) ), + m_recursionLevel, TQT_SLOT( setEnabled(bool) ) ); dvlay->addWidget(m_recurseSubDir); dvlay->addWidget(m_recursionLevel); - m_copyOriginalFiles = new QCheckBox(i18n("Copy or&iginal files"), page); + m_copyOriginalFiles = new TQCheckBox(i18n("Copy or&iginal files"), page); m_copyOriginalFiles->setChecked(m_config->readBoolEntry("CopyOriginalFiles", false) ); dvlay->addWidget(m_copyOriginalFiles); whatsThis = i18n("<p>This makes a copy of all images and the gallery will refer " "to these copies instead of the original images."); - QWhatsThis::add( m_copyOriginalFiles, whatsThis ); + TQWhatsThis::add( m_copyOriginalFiles, whatsThis ); const bool useCommentFile = m_config->readBoolEntry("UseCommentFile", false); - m_useCommentFile = new QCheckBox(i18n("Use &comment file"), page); + m_useCommentFile = new TQCheckBox(i18n("Use &comment file"), page); m_useCommentFile->setChecked(useCommentFile); dvlay->addWidget(m_useCommentFile); @@ -239,9 +239,9 @@ void KIGPDialog::setupDirectoryPage(const QString& path) { "subtitles for the images." "<p>For details about the file format please see " "the \"What's This?\" help below."); - QWhatsThis::add( m_useCommentFile, whatsThis ); + TQWhatsThis::add( m_useCommentFile, whatsThis ); - label = new QLabel(i18n("Comments &file:"), page); + label = new TQLabel(i18n("Comments &file:"), page); label->setEnabled( useCommentFile ); dvlay->addWidget( label ); whatsThis = i18n("<p>You can specify the name of the comment file here. " @@ -254,40 +254,40 @@ void KIGPDialog::setupDirectoryPage(const QString& path) { "<br>Description" "<br>" "<br>and so on"); - QWhatsThis::add( label, whatsThis ); + TQWhatsThis::add( label, whatsThis ); m_commentFileReq = new KURLRequester(path + "comments", page); m_commentFileReq->setEnabled(useCommentFile); label->setBuddy( m_commentFileReq ); dvlay->addWidget(m_commentFileReq); - QWhatsThis::add( m_commentFileReq, whatsThis ); + TQWhatsThis::add( m_commentFileReq, whatsThis ); - connect(m_useCommentFile, SIGNAL(toggled(bool)), - label, SLOT(setEnabled(bool))); - connect(m_useCommentFile, SIGNAL(toggled(bool)), - m_commentFileReq, SLOT(setEnabled(bool))); + connect(m_useCommentFile, TQT_SIGNAL(toggled(bool)), + label, TQT_SLOT(setEnabled(bool))); + connect(m_useCommentFile, TQT_SIGNAL(toggled(bool)), + m_commentFileReq, TQT_SLOT(setEnabled(bool))); dvlay->addStretch(1); } -void KIGPDialog::setupThumbnailPage(const QString& path) { - QFrame *page = addPage( i18n("Thumbnails"), i18n("Thumbnails"), +void KIGPDialog::setupThumbnailPage(const TQString& path) { + TQFrame *page = addPage( i18n("Thumbnails"), i18n("Thumbnails"), BarIcon("thumbnail", KIcon::SizeMedium ) ); m_config->setGroup("Thumbnails"); - QLabel *label; + TQLabel *label; - QVBoxLayout *vlay = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *vlay = new TQVBoxLayout( page, 0, spacingHint() ); - QHBoxLayout *hlay3 = new QHBoxLayout( spacingHint() ); + TQHBoxLayout *hlay3 = new TQHBoxLayout( spacingHint() ); vlay->addLayout( hlay3 ); - m_imageFormat = new QComboBox(false, page); + m_imageFormat = new TQComboBox(false, page); m_imageFormat->insertItem("JPEG"); m_imageFormat->insertItem("PNG"); m_imageFormat->setCurrentText( m_config->readEntry("ImageFormat", "JPEG") ); - label = new QLabel( i18n("Image format f&or the thumbnails:"), page); + label = new TQLabel( i18n("Image format f&or the thumbnails:"), page); hlay3->addWidget( label ); label->setBuddy( m_imageFormat ); hlay3->addStretch( 1 ); @@ -298,17 +298,17 @@ void KIGPDialog::setupThumbnailPage(const QString& path) { m_thumbnailSize->setLabel( i18n("Thumbnail size:") ); vlay->addWidget( m_thumbnailSize ); - QGridLayout *grid = new QGridLayout( 2, 2 ); + TQGridLayout *grid = new TQGridLayout( 2, 2 ); vlay->addLayout( grid ); - QHBoxLayout *hlay4 = new QHBoxLayout( spacingHint() ); + TQHBoxLayout *hlay4 = new TQHBoxLayout( spacingHint() ); vlay->addLayout( hlay4 ); const bool colorDepthSet = m_config->readBoolEntry("ColorDepthSet", false); - m_colorDepthSet = new QCheckBox(i18n("&Set different color depth:"), page); + m_colorDepthSet = new TQCheckBox(i18n("&Set different color depth:"), page); m_colorDepthSet->setChecked(colorDepthSet); hlay4->addWidget( m_colorDepthSet ); - m_colorDepth = new QComboBox(false, page); + m_colorDepth = new TQComboBox(false, page); m_colorDepth->insertItem("1"); m_colorDepth->insertItem("8"); m_colorDepth->insertItem("16"); @@ -317,8 +317,8 @@ void KIGPDialog::setupThumbnailPage(const QString& path) { m_colorDepth->setEnabled(colorDepthSet); hlay4->addWidget( m_colorDepth ); - connect(m_colorDepthSet, SIGNAL( toggled(bool) ), - m_colorDepth, SLOT( setEnabled(bool) ) ); + connect(m_colorDepthSet, TQT_SIGNAL( toggled(bool) ), + m_colorDepth, TQT_SLOT( setEnabled(bool) ) ); vlay->addStretch(1); @@ -354,7 +354,7 @@ KIGPDialog::~KIGPDialog() { } -void KIGPDialog::imageUrlChanged(const QString &url ) +void KIGPDialog::imageUrlChanged(const TQString &url ) { enableButtonOK( !url.isEmpty()); } @@ -414,42 +414,42 @@ bool KIGPDialog::colorDepthSet() const return m_colorDepthSet->isChecked(); } -const QString KIGPDialog::getTitle() const +const TQString KIGPDialog::getTitle() const { return m_title->text(); } -const QString KIGPDialog::getImageName() const +const TQString KIGPDialog::getImageName() const { return m_imageNameReq->url(); } -const QString KIGPDialog::getCommentFile() const +const TQString KIGPDialog::getCommentFile() const { return m_commentFileReq->url(); } -const QString KIGPDialog::getFontName() const +const TQString KIGPDialog::getFontName() const { return m_fontName->currentText(); } -const QString KIGPDialog::getFontSize() const +const TQString KIGPDialog::getFontSize() const { return m_fontSize->text(); } -const QColor KIGPDialog::getBackgroundColor() const +const TQColor KIGPDialog::getBackgroundColor() const { return m_backgroundColor->color(); } -const QColor KIGPDialog::getForegroundColor() const +const TQColor KIGPDialog::getForegroundColor() const { return m_foregroundColor->color(); } -const QString KIGPDialog::getImageFormat() const +const TQString KIGPDialog::getImageFormat() const { return m_imageFormat->currentText(); } diff --git a/konq-plugins/kimgalleryplugin/imgallerydialog.h b/konq-plugins/kimgalleryplugin/imgallerydialog.h index 7aa6163..22cf68e 100644 --- a/konq-plugins/kimgalleryplugin/imgallerydialog.h +++ b/konq-plugins/kimgalleryplugin/imgallerydialog.h @@ -34,14 +34,14 @@ class QSpinBox; class KColorButton; class KConfig; -typedef QMap<QString,QString> CommentMap; +typedef TQMap<TQString,TQString> CommentMap; class KIGPDialog : public KDialogBase { Q_OBJECT public: - KIGPDialog(QWidget *parent=0, const QString& path=0, const char *name=0 ); + KIGPDialog(TQWidget *parent=0, const TQString& path=0, const char *name=0 ); ~KIGPDialog(); bool isDialogOk() const; @@ -58,45 +58,45 @@ class KIGPDialog : public KDialogBase int getThumbnailSize() const; int getColorDepth() const; - const QString getTitle() const; - const QString getImageName() const; - const QString getCommentFile() const; - const QString getFontName() const; - const QString getFontSize() const; + const TQString getTitle() const; + const TQString getImageName() const; + const TQString getCommentFile() const; + const TQString getFontName() const; + const TQString getFontSize() const; - const QColor getBackgroundColor() const; - const QColor getForegroundColor() const; + const TQColor getBackgroundColor() const; + const TQColor getForegroundColor() const; - const QString getImageFormat() const; + const TQString getImageFormat() const; void writeConfig(); protected slots: - void imageUrlChanged(const QString & ); + void imageUrlChanged(const TQString & ); void slotDefault(); private: KColorButton *m_foregroundColor; KColorButton *m_backgroundColor; - QLineEdit *m_title; - QString m_path; + TQLineEdit *m_title; + TQString m_path; KIntNumInput *m_imagesPerRow; KIntNumInput *m_thumbnailSize; KIntNumInput *m_recursionLevel; - QSpinBox *m_fontSize; + TQSpinBox *m_fontSize; - QCheckBox *m_copyOriginalFiles; - QCheckBox *m_imageName; - QCheckBox *m_imageSize; - QCheckBox *m_imageProperty; - QCheckBox *m_useCommentFile; - QCheckBox *m_recurseSubDir; - QCheckBox *m_colorDepthSet; + TQCheckBox *m_copyOriginalFiles; + TQCheckBox *m_imageName; + TQCheckBox *m_imageSize; + TQCheckBox *m_imageProperty; + TQCheckBox *m_useCommentFile; + TQCheckBox *m_recurseSubDir; + TQCheckBox *m_colorDepthSet; - QComboBox* m_fontName; - QComboBox* m_imageFormat; - QComboBox* m_colorDepth; + TQComboBox* m_fontName; + TQComboBox* m_imageFormat; + TQComboBox* m_colorDepth; KURLRequester *m_imageNameReq; KURLRequester *m_commentFileReq; @@ -105,9 +105,9 @@ class KIGPDialog : public KDialogBase KConfig *m_config; private: - void setupLookPage(const QString& path); - void setupDirectoryPage(const QString& path); - void setupThumbnailPage(const QString& path); + void setupLookPage(const TQString& path); + void setupDirectoryPage(const TQString& path); + void setupThumbnailPage(const TQString& path); }; #endif diff --git a/konq-plugins/kimgalleryplugin/imgalleryplugin.cpp b/konq-plugins/kimgalleryplugin/imgalleryplugin.cpp index 43df35b..4b9a5e0 100644 --- a/konq-plugins/kimgalleryplugin/imgalleryplugin.cpp +++ b/konq-plugins/kimgalleryplugin/imgalleryplugin.cpp @@ -18,16 +18,16 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qdir.h> -#include <qtextstream.h> -#include <qfile.h> -#include <qfont.h> -#include <qdatetime.h> -#include <qpixmap.h> -#include <qimage.h> -#include <qprogressdialog.h> -#include <qtextcodec.h> -#include <qstylesheet.h> +#include <tqdir.h> +#include <tqtextstream.h> +#include <tqfile.h> +#include <tqfont.h> +#include <tqdatetime.h> +#include <tqpixmap.h> +#include <tqimage.h> +#include <tqprogressdialog.h> +#include <tqtextcodec.h> +#include <tqstylesheet.h> #include <kaction.h> #include <kglobal.h> @@ -48,11 +48,11 @@ Boston, MA 02110-1301, USA. typedef KGenericFactory<KImGalleryPlugin> KImGalleryPluginFactory; K_EXPORT_COMPONENT_FACTORY( libkimgallery, KImGalleryPluginFactory( "imgalleryplugin" ) ) -KImGalleryPlugin::KImGalleryPlugin( QObject* parent, const char* name, const QStringList & ) +KImGalleryPlugin::KImGalleryPlugin( TQObject* parent, const char* name, const TQStringList & ) : KParts::Plugin( parent, name ), m_commentMap(0) { new KAction( i18n( "&Create Image Gallery..." ), "imagegallery", CTRL+Key_I, this, - SLOT( slotExecute() ), actionCollection(), "create_img_gallery" ); + TQT_SLOT( slotExecute() ), actionCollection(), "create_img_gallery" ); } void KImGalleryPlugin::slotExecute() @@ -71,7 +71,7 @@ void KImGalleryPlugin::slotExecute() kdDebug(90170) << "dialog is ok" << endl; m_configDlg = new KIGPDialog(m_part->widget(), m_part->url().path(+1)); - if ( m_configDlg->exec() == QDialog::Accepted ) { + if ( m_configDlg->exec() == TQDialog::Accepted ) { kdDebug(90170) << "dialog is ok" << endl; m_configDlg->writeConfig(); m_copyFiles = m_configDlg->copyOriginalFiles(); @@ -81,8 +81,8 @@ void KImGalleryPlugin::slotExecute() KURL url(m_configDlg->getImageName()); if ( !url.isEmpty() && url.isValid()) { - m_progressDlg = new QProgressDialog(m_part->widget(), "progressDlg", true ); - QObject::connect(m_progressDlg, SIGNAL( cancelled() ), this, SLOT( slotCancelled() ) ); + m_progressDlg = new TQProgressDialog(m_part->widget(), "progressDlg", true ); + TQObject::connect(m_progressDlg, TQT_SIGNAL( cancelled() ), this, TQT_SLOT( slotCancelled() ) ); m_progressDlg->setLabelText( i18n("Creating thumbnails") ); m_progressDlg->setCancelButton(new KPushButton(KStdGuiItem::cancel(),m_progressDlg)); @@ -100,7 +100,7 @@ void KImGalleryPlugin::slotExecute() delete m_progressDlg; } -bool KImGalleryPlugin::createDirectory(QDir thumb_dir, QString imgGalleryDir, QString dirName) +bool KImGalleryPlugin::createDirectory(TQDir thumb_dir, TQString imgGalleryDir, TQString dirName) { if (!thumb_dir.exists()) { thumb_dir.setPath( imgGalleryDir); @@ -116,25 +116,25 @@ bool KImGalleryPlugin::createDirectory(QDir thumb_dir, QString imgGalleryDir, QS } } -void KImGalleryPlugin::createHead(QTextStream& stream) +void KImGalleryPlugin::createHead(TQTextStream& stream) { - const QString chsetName = QTextCodec::codecForLocale()->mimeName(); + const TQString chsetName = TQTextCodec::codecForLocale()->mimeName(); stream << "<?xml version=\"1.0\" encoding=\"" + chsetName + "\" ?>" << endl; stream << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">" << endl; stream << "<html xmlns=\"http://www.w3.org/1999/xhtml\">" << endl; stream << "<head>" << endl; - stream << "<title>" << QStyleSheet::escape(m_configDlg->getTitle()) << "</title>" << endl; + stream << "<title>" << TQStyleSheet::escape(m_configDlg->getTitle()) << "</title>" << endl; stream << "<meta http-equiv=\"content-type\" content=\"text/html; charset=" << chsetName << "\"/>" << endl; stream << "<meta name=\"GENERATOR\" content=\"KDE Konqueror KImgallery plugin version " KDE_VERSION_STRING "\"/>" << endl; createCSSSection(stream); stream << "</head>" << endl; } -void KImGalleryPlugin::createCSSSection(QTextStream& stream) +void KImGalleryPlugin::createCSSSection(TQTextStream& stream) { - const QString backgroundColor = m_configDlg->getBackgroundColor().name(); - const QString foregroundColor = m_configDlg->getForegroundColor().name(); + const TQString backgroundColor = m_configDlg->getBackgroundColor().name(); + const TQString foregroundColor = m_configDlg->getForegroundColor().name(); //adding a touch of style stream << "<style type='text/css'>\n"; stream << "BODY {color: " << foregroundColor << "; background: " << backgroundColor << ";" << endl; @@ -148,24 +148,24 @@ void KImGalleryPlugin::createCSSSection(QTextStream& stream) } -QString KImGalleryPlugin::extension(const QString& imageFormat) +TQString KImGalleryPlugin::extension(const TQString& imageFormat) { if (imageFormat == "PNG") return ".png"; if (imageFormat == "JPEG") return ".jpg"; Q_ASSERT(false); - return QString::null; + return TQString::null; } -void KImGalleryPlugin::createBody(QTextStream& stream, const QString& sourceDirName, const QStringList& subDirList, - const QDir& imageDir, const KURL& url, const QString& imageFormat) +void KImGalleryPlugin::createBody(TQTextStream& stream, const TQString& sourceDirName, const TQStringList& subDirList, + const TQDir& imageDir, const KURL& url, const TQString& imageFormat) { int numOfImages = imageDir.count(); - const QString imgGalleryDir = url.directory(); - const QString today(KGlobal::locale()->formatDate(QDate::currentDate())); + const TQString imgGalleryDir = url.directory(); + const TQString today(KGlobal::locale()->formatDate(TQDate::currentDate())); - stream << "<body>\n<h1>" << QStyleSheet::escape(m_configDlg->getTitle()) << "</h1><p>" << endl; + stream << "<body>\n<h1>" << TQStyleSheet::escape(m_configDlg->getTitle()) << "</h1><p>" << endl; stream << i18n("<i>Number of images</i>: %1").arg(numOfImages) << "<br/>" << endl; stream << i18n("<i>Created on</i>: %1").arg(today) << "</p>" << endl; @@ -173,7 +173,7 @@ void KImGalleryPlugin::createBody(QTextStream& stream, const QString& sourceDirN if (m_recurseSubDirectories && subDirList.count() > 2) { //subDirList.count() is always >= 2 because of the "." and ".." directories stream << i18n("<i>Subfolders</i>:") << "<br>" << endl; - for (QStringList::ConstIterator it = subDirList.begin(); it != subDirList.end(); it++) { + for (TQStringList::ConstIterator it = subDirList.begin(); it != subDirList.end(); it++) { if (*it == "." || *it == "..") continue; //disregard the "." and ".." directories stream << "<a href=\"" << *it << "/" << url.fileName() @@ -186,13 +186,13 @@ void KImGalleryPlugin::createBody(QTextStream& stream, const QString& sourceDirN //table with images int imgIndex; - QFileInfo imginfo; - QPixmap imgProp; + TQFileInfo imginfo; + TQPixmap imgProp; for (imgIndex = 0; !m_cancelled && (imgIndex < numOfImages);) { stream << "<tr>" << endl; for (int col=0; !m_cancelled && (col < m_imagesPerRow) && (imgIndex < numOfImages); col++) { - const QString imgName = imageDir[imgIndex]; + const TQString imgName = imageDir[imgIndex]; if (m_copyFiles) { stream << "<td align='center'>\n<a href=\"images/" << imgName << "\">"; @@ -202,7 +202,7 @@ void KImGalleryPlugin::createBody(QTextStream& stream, const QString& sourceDirN if (createThumb(imgName, sourceDirName, imgGalleryDir, imageFormat)) { - const QString imgPath("thumbs/" + imgName + extension(imageFormat)); + const TQString imgPath("thumbs/" + imgName + extension(imageFormat)); stream << "<img src=\"" << imgPath << "\" width=\"" << m_imgWidth << "\" "; stream << "height=\"" << m_imgHeight << "\" alt=\"" << imgPath << "\"/>"; m_progressDlg->setLabelText( i18n("Created thumbnail for: \n%1").arg(imgName) ); @@ -227,8 +227,8 @@ void KImGalleryPlugin::createBody(QTextStream& stream, const QString& sourceDirN } if (m_useCommentFile) { - QString imgComment = (*m_commentMap)[imgName]; - stream << "<div>" << QStyleSheet::escape(imgComment) << "</div>" << endl; + TQString imgComment = (*m_commentMap)[imgName]; + stream << "<div>" << TQStyleSheet::escape(imgComment) << "</div>" << endl; } stream << "</td>" << endl; @@ -244,7 +244,7 @@ void KImGalleryPlugin::createBody(QTextStream& stream, const QString& sourceDirN } -bool KImGalleryPlugin::createHtml(const KURL& url, const QString& sourceDirName, int recursionLevel, const QString& imageFormat) +bool KImGalleryPlugin::createHtml(const KURL& url, const TQString& sourceDirName, int recursionLevel, const TQString& imageFormat) { if(m_cancelled) return false; @@ -253,16 +253,16 @@ bool KImGalleryPlugin::createHtml(const KURL& url, const QString& sourceDirName, return false; KonqDirPart * part = static_cast<KonqDirPart *>(parent()); - QStringList subDirList; + TQStringList subDirList; if (m_recurseSubDirectories && (recursionLevel >= 0)) { //recursionLevel == 0 means endless - QDir toplevel_dir = QDir( sourceDirName ); - toplevel_dir.setFilter( QDir::Dirs | QDir::Readable | QDir::Writable ); + TQDir toplevel_dir = TQDir( sourceDirName ); + toplevel_dir.setFilter( TQDir::Dirs | TQDir::Readable | TQDir::Writable ); subDirList = toplevel_dir.entryList(); - for (QStringList::ConstIterator it = subDirList.begin(); it != subDirList.end() && !m_cancelled; it++) { - const QString currentDir = *it; + for (TQStringList::ConstIterator it = subDirList.begin(); it != subDirList.end() && !m_cancelled; it++) { + const TQString currentDir = *it; if (currentDir == "." || currentDir == "..") { continue;} //disregard the "." and ".." directories - QDir subDir = QDir( url.directory() + "/" + currentDir ); + TQDir subDir = TQDir( url.directory() + "/" + currentDir ); if (!subDir.exists()) { subDir.setPath( url.directory() ); if (!(subDir.mkdir(currentDir, false))) { @@ -284,33 +284,33 @@ bool KImGalleryPlugin::createHtml(const KURL& url, const QString& sourceDirName, kdDebug(90170) << "sourceDirName: " << sourceDirName << endl; //We're interested in only the patterns, so look for the first | //#### perhaps an accessor should be added to KImageIO instead? - QString filter = KImageIO::pattern(KImageIO::Reading).section('|', 0, 0); + TQString filter = KImageIO::pattern(KImageIO::Reading).section('|', 0, 0); - QDir imageDir( sourceDirName, filter.latin1(), - QDir::Name|QDir::IgnoreCase, QDir::Files|QDir::Readable); + TQDir imageDir( sourceDirName, filter.latin1(), + TQDir::Name|TQDir::IgnoreCase, TQDir::Files|TQDir::Readable); - const QString imgGalleryDir = url.directory(); + const TQString imgGalleryDir = url.directory(); kdDebug(90170) << "imgGalleryDir: " << imgGalleryDir << endl; // Create the "thumbs" subdirectory if necessary - QDir thumb_dir( imgGalleryDir + QString::fromLatin1("/thumbs/")); + TQDir thumb_dir( imgGalleryDir + TQString::fromLatin1("/thumbs/")); if (createDirectory(thumb_dir, imgGalleryDir, "thumbs") == false) return false; // Create the "images" subdirectory if necessary - QDir images_dir( imgGalleryDir + QString::fromLatin1("/images/")); + TQDir images_dir( imgGalleryDir + TQString::fromLatin1("/images/")); if (m_copyFiles) { if (createDirectory(images_dir, imgGalleryDir, "images") == false) return false; } - QFile file( url.path() ); + TQFile file( url.path() ); kdDebug(90170) << "url.path(): " << url.path() << ", thumb_dir: "<< thumb_dir.path() << ", imageDir: "<< imageDir.path() << endl; if ( imageDir.exists() && file.open(IO_WriteOnly) ) { - QTextStream stream(&file); - stream.setEncoding(QTextStream::Locale); + TQTextStream stream(&file); + stream.setEncoding(TQTextStream::Locale); createHead(stream); createBody(stream, sourceDirName, subDirList, imageDir, url, imageFormat); //ugly @@ -325,15 +325,15 @@ bool KImGalleryPlugin::createHtml(const KURL& url, const QString& sourceDirName, } } -void KImGalleryPlugin::deleteCancelledGallery(const KURL& url, const QString& sourceDirName, int recursionLevel, const QString& imageFormat) +void KImGalleryPlugin::deleteCancelledGallery(const KURL& url, const TQString& sourceDirName, int recursionLevel, const TQString& imageFormat) { if (m_recurseSubDirectories && (recursionLevel >= 0)) { - QStringList subDirList; - QDir toplevel_dir = QDir( sourceDirName ); - toplevel_dir.setFilter( QDir::Dirs ); + TQStringList subDirList; + TQDir toplevel_dir = TQDir( sourceDirName ); + toplevel_dir.setFilter( TQDir::Dirs ); subDirList = toplevel_dir.entryList(); - for (QStringList::ConstIterator it = subDirList.begin(); it != subDirList.end(); it++) { + for (TQStringList::ConstIterator it = subDirList.begin(); it != subDirList.end(); it++) { if (*it == "." || *it == ".." || *it == "thumbs" || (m_copyFiles && *it == "images")) { continue; //disregard the "." and ".." directories } @@ -343,19 +343,19 @@ void KImGalleryPlugin::deleteCancelledGallery(const KURL& url, const QString& so } } - const QString imgGalleryDir = url.directory(); - QDir thumb_dir( imgGalleryDir + QString::fromLatin1("/thumbs/")); - QDir images_dir( imgGalleryDir + QString::fromLatin1("/images/")); - QDir imageDir( sourceDirName, "*.png *.PNG *.gif *.GIF *.jpg *.JPG *.jpeg *.JPEG *.bmp *.BMP", - QDir::Name|QDir::IgnoreCase, QDir::Files|QDir::Readable); - QFile file( url.path() ); + const TQString imgGalleryDir = url.directory(); + TQDir thumb_dir( imgGalleryDir + TQString::fromLatin1("/thumbs/")); + TQDir images_dir( imgGalleryDir + TQString::fromLatin1("/images/")); + TQDir imageDir( sourceDirName, "*.png *.PNG *.gif *.GIF *.jpg *.JPG *.jpeg *.JPEG *.bmp *.BMP", + TQDir::Name|TQDir::IgnoreCase, TQDir::Files|TQDir::Readable); + TQFile file( url.path() ); // Remove the image file .. file.remove(); // ..all the thumbnails .. for (uint i=0; i < imageDir.count(); i++) { - const QString imgName = imageDir[i]; - const QString imgNameFormat = imgName + extension(imageFormat); + const TQString imgName = imageDir[i]; + const TQString imgNameFormat = imgName + extension(imageFormat); bool isRemoved = thumb_dir.remove(imgNameFormat); kdDebug(90170) << "removing: " << thumb_dir.path() << "/" << imgNameFormat << "; "<< isRemoved << endl; } @@ -365,7 +365,7 @@ void KImGalleryPlugin::deleteCancelledGallery(const KURL& url, const QString& so // ..and the images directory if images were to be copied if (m_copyFiles) { for (uint i=0; i < imageDir.count(); i++) { - const QString imgName = imageDir[i]; + const TQString imgName = imageDir[i]; bool isRemoved = images_dir.remove(imgName); kdDebug(90170) << "removing: " << images_dir.path() << "/" << imgName << "; "<< isRemoved << endl; } @@ -375,24 +375,24 @@ void KImGalleryPlugin::deleteCancelledGallery(const KURL& url, const QString& so void KImGalleryPlugin::loadCommentFile() { - QFile file(m_configDlg->getCommentFile()); + TQFile file(m_configDlg->getCommentFile()); if (file.open(IO_ReadOnly)) { kdDebug(90170) << "File opened."<< endl; - QTextStream* m_textStream = new QTextStream(&file); - m_textStream->setEncoding(QTextStream::Locale); + TQTextStream* m_textStream = new TQTextStream(&file); + m_textStream->setEncoding(TQTextStream::Locale); delete m_commentMap; m_commentMap = new CommentMap; - QString picName, picComment, curLine, curLineStripped; + TQString picName, picComment, curLine, curLineStripped; while (!m_textStream->eof()) { curLine = m_textStream->readLine(); curLineStripped = curLine.stripWhiteSpace(); // Lines starting with '#' are comment if (!(curLineStripped.isEmpty()) && !curLineStripped.startsWith("#")) { if (curLineStripped.endsWith(":")) { - picComment = QString::null; + picComment = TQString::null; picName = curLineStripped.left(curLineStripped.length()-1); kdDebug(90170) << "picName: " << picName << endl; } else { @@ -420,22 +420,22 @@ void KImGalleryPlugin::loadCommentFile() } } -bool KImGalleryPlugin::createThumb( const QString& imgName, const QString& sourceDirName, - const QString& imgGalleryDir, const QString& imageFormat) +bool KImGalleryPlugin::createThumb( const TQString& imgName, const TQString& sourceDirName, + const TQString& imgGalleryDir, const TQString& imageFormat) { - QImage img; - const QString pixPath = sourceDirName + QString::fromLatin1("/") + imgName; + TQImage img; + const TQString pixPath = sourceDirName + TQString::fromLatin1("/") + imgName; if (m_copyFiles) { KURL srcURL = KURL::fromPathOrURL(pixPath); //kdDebug(90170) << "srcURL: " << srcURL << endl; - KURL destURL = KURL::fromPathOrURL(imgGalleryDir + QString::fromLatin1("/images/") + imgName); + KURL destURL = KURL::fromPathOrURL(imgGalleryDir + TQString::fromLatin1("/images/") + imgName); //kdDebug(90170) << "destURL: " << destURL << endl; KIO::NetAccess::copy(srcURL, destURL, static_cast<KParts::Part *>(parent())->widget()); } - const QString imgNameFormat = imgName + extension(imageFormat); - const QString thumbDir = imgGalleryDir + QString::fromLatin1("/thumbs/"); + const TQString imgNameFormat = imgName + extension(imageFormat); + const TQString thumbDir = imgGalleryDir + TQString::fromLatin1("/thumbs/"); int extent = m_configDlg->getThumbnailSize(); // this code is stolen from kdebase/kioslave/thumbnail/imagecreator.cpp @@ -465,7 +465,7 @@ bool KImGalleryPlugin::createThumb( const QString& imgName, const QString& sourc h = extent; Q_ASSERT( w <= extent ); } - const QImage scaleImg(img.smoothScale( w, h )); + const TQImage scaleImg(img.smoothScale( w, h )); if ( scaleImg.width() != w || scaleImg.height() != h ) { kdDebug(90170) << "Resizing failed. Aborting." << endl; @@ -474,7 +474,7 @@ bool KImGalleryPlugin::createThumb( const QString& imgName, const QString& sourc img = scaleImg; if (m_configDlg->colorDepthSet() == true ) { - const QImage depthImg(img.convertDepth(m_configDlg->getColorDepth())); + const TQImage depthImg(img.convertDepth(m_configDlg->getColorDepth())); img = depthImg; } } diff --git a/konq-plugins/kimgalleryplugin/imgalleryplugin.h b/konq-plugins/kimgalleryplugin/imgalleryplugin.h index 6b580a0..7520f0b 100644 --- a/konq-plugins/kimgalleryplugin/imgalleryplugin.h +++ b/konq-plugins/kimgalleryplugin/imgalleryplugin.h @@ -30,14 +30,14 @@ class QProgressDialog; class KURL; class KIGPDialog; -typedef QMap<QString,QString> CommentMap; +typedef TQMap<TQString,TQString> CommentMap; class KImGalleryPlugin : public KParts::Plugin { Q_OBJECT public: - KImGalleryPlugin( QObject* parent, const char* name, - const QStringList & ); + KImGalleryPlugin( TQObject* parent, const char* name, + const TQStringList & ); ~KImGalleryPlugin() {} public slots: @@ -54,7 +54,7 @@ class KImGalleryPlugin : public KParts::Plugin int m_imgHeight; int m_imagesPerRow; - QProgressDialog *m_progressDlg; + TQProgressDialog *m_progressDlg; KonqDirPart* m_part; @@ -62,19 +62,19 @@ class KImGalleryPlugin : public KParts::Plugin CommentMap* m_commentMap; - bool createDirectory(QDir thumb_dir, QString imgGalleryDir, QString dirName); + bool createDirectory(TQDir thumb_dir, TQString imgGalleryDir, TQString dirName); - void createHead(QTextStream& stream); - void createCSSSection(QTextStream& stream); - void createBody(QTextStream& stream, const QString& sourceDirName, const QStringList& subDirList, const QDir& imageDir, const KURL& url, const QString& imageFormat); + void createHead(TQTextStream& stream); + void createCSSSection(TQTextStream& stream); + void createBody(TQTextStream& stream, const TQString& sourceDirName, const TQStringList& subDirList, const TQDir& imageDir, const KURL& url, const TQString& imageFormat); - bool createThumb( const QString& imgName, const QString& sourceDirName, const QString& imgGalleryDir, const QString& imageFormat); + bool createThumb( const TQString& imgName, const TQString& sourceDirName, const TQString& imgGalleryDir, const TQString& imageFormat); - bool createHtml( const KURL& url, const QString& sourceDirName, int recursionLevel, const QString& imageFormat); - void deleteCancelledGallery( const KURL& url, const QString& sourceDirName, int recursionLevel, const QString& imageFormat); + bool createHtml( const KURL& url, const TQString& sourceDirName, int recursionLevel, const TQString& imageFormat); + void deleteCancelledGallery( const KURL& url, const TQString& sourceDirName, int recursionLevel, const TQString& imageFormat); void loadCommentFile(); - static QString extension(const QString& imageFormat); + static TQString extension(const TQString& imageFormat); }; #endif |