diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2026-03-08 12:14:39 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2026-03-08 12:14:39 +0900 |
| commit | 3806b793ad0f5432c58cbc2e71aeecd66e30a00a (patch) | |
| tree | 0fcd68ee5a20b8918df15a8f2901422c53914912 | |
| parent | 88292fc1c6f9b4def47495523178e455a4d4cfb9 (diff) | |
| download | tdenetwork-3806b793ad0f5432c58cbc2e71aeecd66e30a00a.tar.gz tdenetwork-3806b793ad0f5432c58cbc2e71aeecd66e30a00a.zip | |
Remove use of KDE_IS_VERSION
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
33 files changed, 24 insertions, 1147 deletions
diff --git a/kopete/configure.in.in b/kopete/configure.in.in index 989b410d..39313d4b 100644 --- a/kopete/configure.in.in +++ b/kopete/configure.in.in @@ -16,35 +16,6 @@ KDE_CHECK_HEADERS(knotifydialog.h) KOPETE_INCLUDES='-I$(top_srcdir)/kopete/libkopete -I$(top_builddir)/kopete/libkopete -I$(top_srcdir)/kopete/libkopete/avdevice -I$(top_srcdir)/kopete/libkopete/ui -I$(top_builddir)/kopete/libkopete/ui' -AC_MSG_CHECKING([for tdelibs newer than 3.3.x]) -AC_LANG_SAVE -AC_LANG_CPLUSPLUS -kcompat_save_CXXFLAGS="$CXXFLAGS" -kcompat_safe_LIBS="$LIBS" -LIBS="$LIBS $X_EXTRA_LIBS" -CXXFLAGS="$CXXFLAGS $all_includes" - -AC_TRY_COMPILE([ -#include <tdeversion.h> -#if !( KDE_IS_VERSION( 3, 3, 90 ) ) -#error Kopete compatibility with KDE 3.3 needs to be enabled -#endif -], -[ -], - AC_MSG_RESULT(yes) -, - KOPETE_COMPAT_INCLUDES='-I$(top_srcdir)/kopete/libkopete/compat' - KOPETE_INCLUDES=$KOPETE_INCLUDES' $(KOPETE_COMPAT_INCLUDES)' - LIB_KOPETECOMPAT='$(top_builddir)/kopete/libkopete/libkopete.la' - AC_MSG_RESULT(no) -) -CXXFLAGS="$kcompat_save_CXXFLAGS" -LIBS="$kcompat_safe_LIBS" -AC_LANG_RESTORE -AM_CONDITIONAL(compile_LIBKOPETE_COMPAT, test -n "$LIB_KOPETECOMPAT") - - AC_ARG_ENABLE(smpppd, [AC_HELP_STRING([--enable-smpppd], [enable support for the SuSE Meta PPP Daemon (smpppd) (default is NO)])], [ @@ -133,8 +104,6 @@ AC_SUBST(LIBXML_CFLAGS) AC_SUBST(LIBXML_RPATH) AC_SUBST(KOPETE_INCLUDES) -AC_SUBST(KOPETE_COMPAT_INCLUDES) -AC_SUBST(LIB_KOPETECOMPAT) KDE_CHECK_HEADERS( diff --git a/kopete/kopete/chatwindow/Makefile.am b/kopete/kopete/chatwindow/Makefile.am index 2c3de33d..d7503077 100644 --- a/kopete/kopete/chatwindow/Makefile.am +++ b/kopete/kopete/chatwindow/Makefile.am @@ -2,15 +2,15 @@ kde_module_LTLIBRARIES = libkrichtexteditpart.la kopete_chatwindow.la kopete_ema noinst_LTLIBRARIES = libkopetechatwindow.la METASOURCES = AUTO -AM_CPPFLAGS = $(KOPETE_INCLUDES) $(KOPETE_COMPAT_INCLUDES) -I$(top_srcdir)/kopete/libkopete/private -I$(top_srcdir)/kopete/kopete $(all_includes) +AM_CPPFLAGS = $(KOPETE_INCLUDES) -I$(top_srcdir)/kopete/libkopete/private -I$(top_srcdir)/kopete/kopete $(all_includes) kopete_chatwindow_la_SOURCES = chatview.cpp kopetechatwindow.cpp chatmemberslistwidget.cpp kopete_chatwindow_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all_libraries) -kopete_chatwindow_la_LIBADD = ../../libkopete/libkopete.la ./libkopetechatwindow.la $(LIB_KOPETECOMPAT) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor $(LIB_TDEPARTS) +kopete_chatwindow_la_LIBADD = ../../libkopete/libkopete.la ./libkopetechatwindow.la $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor $(LIB_TDEPARTS) kopete_emailwindow_la_SOURCES = kopeteemailwindow.cpp kopete_emailwindow_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all_libraries) -kopete_emailwindow_la_LIBADD = ../../libkopete/libkopete.la ./libkopetechatwindow.la $(LIB_KOPETECOMPAT) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor $(LIB_TDEPARTS) +kopete_emailwindow_la_LIBADD = ../../libkopete/libkopete.la ./libkopetechatwindow.la $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor $(LIB_TDEPARTS) libkrichtexteditpart_la_SOURCES = krichtexteditpart.cpp libkrichtexteditpart_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) $(KDE_RPATH) @@ -20,7 +20,7 @@ libkopetechatwindow_la_SOURCES = chatmessagepart.cpp emoticonselector.cpp kopete chattexteditpart.cpp krichtexteditpart.cpp kopetechatwindowstylemanager.cpp \ kopetechatwindowstyle.cpp libkopetechatwindow_la_LDFLAGS = $(all_libraries) -no-undefined -libkopetechatwindow_la_LIBADD = ../../libkopete/libkopete.la $(LIB_KOPETECOMPAT) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor $(LIB_TDEPARTS) +libkopetechatwindow_la_LIBADD = ../../libkopete/libkopete.la $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor $(LIB_TDEPARTS) partdir = $(kde_datadir)/kopeterichtexteditpart part_DATA = kopeterichtexteditpartfull.rc diff --git a/kopete/kopete/chatwindow/chatmessagepart.cpp b/kopete/kopete/chatwindow/chatmessagepart.cpp index e76e6687..6e7e76c2 100644 --- a/kopete/kopete/chatwindow/chatmessagepart.cpp +++ b/kopete/kopete/chatwindow/chatmessagepart.cpp @@ -85,34 +85,6 @@ #include "kopetechatwindowstyle.h" #include "kopetechatwindowstylemanager.h" -#if !(KDE_IS_VERSION(3,3,90)) -//From tdelibs/tdehtml/misc/htmltags.h -// used in ChatMessagePart::copy() -#define ID_BLOCKQUOTE 12 -#define ID_BR 14 -#define ID_DD 22 -#define ID_DIV 26 -#define ID_DL 27 -#define ID_DT 28 -#define ID_H1 36 -#define ID_H2 37 -#define ID_H3 38 -#define ID_H4 39 -#define ID_H5 40 -#define ID_H6 41 -#define ID_HR 43 -#define ID_IMG 48 -#define ID_LI 57 -#define ID_OL 69 -#define ID_P 72 -#define ID_PRE 75 -#define ID_TD 90 -#define ID_TH 93 -#define ID_TR 96 -#define ID_TT 97 -#define ID_UL 99 -#endif - class ToolTip; class ChatMessagePart::Private @@ -821,123 +793,12 @@ void ChatMessagePart::copy(bool justselection /* default false */) TQString text; TQString htmltext; -#if KDE_IS_VERSION(3,3,90) htmltext = selectedTextAsHTML(); text = selectedText(); //selectedText is now sufficent // text=Kopete::Message::unescape( htmltext ).stripWhiteSpace(); // Message::unsescape will replace image by his title attribute // stripWhiteSpace is for removing the newline added by the <!DOCTYPE> and other xml things of RangeImpl::toHTML -#else - - DOM::Node startNode, endNode; - long startOffset, endOffset; - selection( startNode, startOffset, endNode, endOffset ); - - //BEGIN: copied from TDEHTMLPart::selectedText - - bool hasNewLine = true; - DOM::Node n = startNode; - while(!n.isNull()) - { - if(n.nodeType() == DOM::Node::TEXT_NODE /*&& n.handle()->renderer()*/) - { - TQString str = n.nodeValue().string(); - hasNewLine = false; - if(n == startNode && n == endNode) - text = str.mid(startOffset, endOffset - startOffset); - else if(n == startNode) - text = str.mid(startOffset); - else if(n == endNode) - text += str.left(endOffset); - else - text += str; - } - else - { // This is our simple HTML -> ASCII transformation: - unsigned short id = n.elementId(); - switch(id) - { - case ID_IMG: //here is the main difference with TDEHTMLView::selectedText - { - DOM::HTMLElement e = n; - if( !e.isNull() && e.hasAttribute( "title" ) ) - text+=e.getAttribute( "title" ).string(); - break; - } - case ID_BR: - text += "\n"; - hasNewLine = true; - break; - case ID_TD: case ID_TH: case ID_HR: - case ID_OL: case ID_UL: case ID_LI: - case ID_DD: case ID_DL: case ID_DT: - case ID_PRE: case ID_BLOCKQUOTE: case ID_DIV: - if (!hasNewLine) - text += "\n"; - hasNewLine = true; - break; - case ID_P: case ID_TR: - case ID_H1: case ID_H2: case ID_H3: - case ID_H4: case ID_H5: case ID_H6: - if (!hasNewLine) - text += "\n"; - text += "\n"; - hasNewLine = true; - break; - } - } - if(n == endNode) - break; - DOM::Node next = n.firstChild(); - if(next.isNull()) - next = n.nextSibling(); - while( next.isNull() && !n.parentNode().isNull() ) - { - n = n.parentNode(); - next = n.nextSibling(); - unsigned short id = n.elementId(); - switch(id) - { - case ID_TD: case ID_TH: case ID_HR: - case ID_OL: case ID_UL: case ID_LI: - case ID_DD: case ID_DL: case ID_DT: - case ID_PRE: case ID_BLOCKQUOTE: case ID_DIV: - if (!hasNewLine) - text += "\n"; - hasNewLine = true; - break; - case ID_P: case ID_TR: - case ID_H1: case ID_H2: case ID_H3: - case ID_H4: case ID_H5: case ID_H6: - if (!hasNewLine) - text += "\n"; - text += "\n"; - hasNewLine = true; - break; - } - } - n = next; - } - - if(text.isEmpty()) - return; - - int start = 0; - int end = text.length(); - - // Strip leading LFs - while ((start < end) && (text[start] == '\n')) - start++; - - // Strip excessive trailing LFs - while ((start < (end-1)) && (text[end-1] == '\n') && (text[end-2] == '\n')) - end--; - - text=text.mid(start, end-start); - - //END: copied from TDEHTMLPart::selectedText -#endif if(text.isEmpty()) return; diff --git a/kopete/kopete/chatwindow/kopetechatwindow.cpp b/kopete/kopete/chatwindow/kopetechatwindow.cpp index 1e7d495e..0702526a 100644 --- a/kopete/kopete/chatwindow/kopetechatwindow.cpp +++ b/kopete/kopete/chatwindow/kopetechatwindow.cpp @@ -596,9 +596,7 @@ void KopeteChatWindow::createTabBar() m_tabBar->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ) ); m_tabBar->setHoverCloseButton(TDEGlobal::config()->readBoolEntry( TQString::fromLatin1("HoverClose"), false )); m_tabBar->setTabReorderingEnabled(true); -#if KDE_IS_VERSION(3,4,0) m_tabBar->setAutomaticResizeTabs(true); -#endif connect( m_tabBar, TQ_SIGNAL( closeRequest( TQWidget* )), this, TQ_SLOT( slotCloseChat( TQWidget* ) ) ); TQToolButton* m_rightWidget = new TQToolButton( m_tabBar ); diff --git a/kopete/kopete/config/accounts/Makefile.am b/kopete/kopete/config/accounts/Makefile.am index 0d713d99..e29db854 100644 --- a/kopete/kopete/config/accounts/Makefile.am +++ b/kopete/kopete/config/accounts/Makefile.am @@ -2,14 +2,14 @@ kopete_srcdir=$(top_srcdir)/kopete kopete_builddir=$(top_builddir)/kopete METASOURCES = AUTO -AM_CPPFLAGS = $(KOPETE_INCLUDES) $(KOPETE_COMPAT_INCLUDES) $(all_includes) -I$(kopete_srcdir)/kopete/addaccountwizard +AM_CPPFLAGS = $(KOPETE_INCLUDES) $(all_includes) -I$(kopete_srcdir)/kopete/addaccountwizard kde_module_LTLIBRARIES = kcm_kopete_accountconfig.la kcm_kopete_accountconfig_la_SOURCES = kopeteaccountconfigbase.ui kopeteaccountconfig.cpp kcm_kopete_accountconfig_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all_libraries) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -kcm_kopete_accountconfig_la_LIBADD = ../../../libkopete/libkopete.la ../../addaccountwizard/libkopeteaddaccountwizard.la $(LIB_KOPETECOMPAT) $(LIB_TDEUTILS) +kcm_kopete_accountconfig_la_LIBADD = ../../../libkopete/libkopete.la ../../addaccountwizard/libkopeteaddaccountwizard.la $(LIB_TDEUTILS) service_DATA = kopete_accountconfig.desktop servicedir = $(kde_servicesdir) diff --git a/kopete/kopete/config/appearance/Makefile.am b/kopete/kopete/config/appearance/Makefile.am index 1c591b28..498e8a4a 100644 --- a/kopete/kopete/config/appearance/Makefile.am +++ b/kopete/kopete/config/appearance/Makefile.am @@ -1,6 +1,6 @@ METASOURCES = AUTO AM_CPPFLAGS = $(KOPETE_INCLUDES) -I$(top_srcdir)/kopete/libkopete/private \ - -I$(top_srcdir)/kopete/kopete/chatwindow $(KOPETE_COMPAT_INCLUDES) $(all_includes) + -I$(top_srcdir)/kopete/kopete/chatwindow $(all_includes) kde_module_LTLIBRARIES = kcm_kopete_appearanceconfig.la @@ -13,7 +13,7 @@ kcm_kopete_appearanceconfig_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) \ $(all_libraries) kcm_kopete_appearanceconfig_la_LIBADD = ../../../libkopete/libkopete.la \ ../../../kopete/chatwindow/libkopetechatwindow.la \ - -ltdetexteditor $(LIB_KOPETECOMPAT) $(LIB_TDEUTILS) $(LIB_TDENEWSTUFF) + -ltdetexteditor $(LIB_TDEUTILS) $(LIB_TDENEWSTUFF) service_DATA = kopete_appearanceconfig.desktop servicedir = $(kde_servicesdir) diff --git a/kopete/kopete/config/avdevice/Makefile.am b/kopete/kopete/config/avdevice/Makefile.am index 1679b8ea..f6ad4eb4 100644 --- a/kopete/kopete/config/avdevice/Makefile.am +++ b/kopete/kopete/config/avdevice/Makefile.am @@ -1,7 +1,7 @@ METASOURCES = AUTO AM_CPPFLAGS = $(KOPETE_INCLUDES) \ -I$(top_srcdir)/kopete/libkopete/avdevice \ - -I$(top_srcdir)/kopete/libkopete/private $(KOPETE_COMPAT_INCLUDES) $(all_includes) + -I$(top_srcdir)/kopete/libkopete/private $(all_includes) kde_module_LTLIBRARIES = kcm_kopete_avdeviceconfig.la @@ -12,7 +12,7 @@ kcm_kopete_avdeviceconfig_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all kcm_kopete_avdeviceconfig_la_LIBADD = ../../../libkopete/libkopete.la \ ../../../libkopete/avdevice/libkopete_videodevice.la \ - $(LIB_KOPETECOMPAT) $(LIB_TDEUTILS) + $(LIB_TDEUTILS) service_DATA = kopete_avdeviceconfig.desktop servicedir = $(kde_servicesdir) diff --git a/kopete/kopete/config/behavior/Makefile.am b/kopete/kopete/config/behavior/Makefile.am index 8f8fdddb..d95dcb53 100644 --- a/kopete/kopete/config/behavior/Makefile.am +++ b/kopete/kopete/config/behavior/Makefile.am @@ -1,5 +1,5 @@ METASOURCES = AUTO -AM_CPPFLAGS = $(KOPETE_INCLUDES) -I$(top_srcdir)/kopete/libkopete/private $(KOPETE_COMPAT_INCLUDES) $(all_includes) +AM_CPPFLAGS = $(KOPETE_INCLUDES) -I$(top_srcdir)/kopete/libkopete/private $(all_includes) kde_module_LTLIBRARIES = kcm_kopete_behaviorconfig.la @@ -10,7 +10,7 @@ kcm_kopete_behaviorconfig_la_SOURCES = \ kcm_kopete_behaviorconfig_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all_libraries) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor kcm_kopete_behaviorconfig_la_LIBADD = ../../../libkopete/libkopete.la \ - $(LIB_KOPETECOMPAT) $(LIB_TDEUTILS) + $(LIB_TDEUTILS) service_DATA = kopete_behaviorconfig.desktop servicedir = $(kde_servicesdir) diff --git a/kopete/kopete/config/identity/Makefile.am b/kopete/kopete/config/identity/Makefile.am index 2c98d1d2..e6c459b4 100644 --- a/kopete/kopete/config/identity/Makefile.am +++ b/kopete/kopete/config/identity/Makefile.am @@ -1,12 +1,12 @@ METASOURCES = AUTO -AM_CPPFLAGS = $(KOPETE_INCLUDES) $(KOPETE_COMPAT_INCLUDES) $(all_includes) +AM_CPPFLAGS = $(KOPETE_INCLUDES) $(all_includes) kde_module_LTLIBRARIES = kcm_kopete_identityconfig.la kcm_kopete_identityconfig_la_SOURCES = kopeteidentityconfigbase.ui \ kopeteidentityconfig.cpp globalidentitiesmanager.cpp kopeteidentityconfigpreferences.kcfgc kcm_kopete_identityconfig_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all_libraries) -kcm_kopete_identityconfig_la_LIBADD = -ltdeabc ../../../libkopete/libkopete.la $(LIB_KOPETECOMPAT) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor +kcm_kopete_identityconfig_la_LIBADD = -ltdeabc ../../../libkopete/libkopete.la $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor service_DATA = kopete_identityconfig.desktop servicedir = $(kde_servicesdir) diff --git a/kopete/kopete/contactlist/kopetelviprops.cpp b/kopete/kopete/contactlist/kopetelviprops.cpp index 32599f53..a44feace 100644 --- a/kopete/kopete/contactlist/kopetelviprops.cpp +++ b/kopete/kopete/contactlist/kopetelviprops.cpp @@ -307,11 +307,7 @@ void KopeteMetaLVIProps::slotLoadPhotoSources() m_withPhotoContacts.insert(mainWidget->cmbAccountPhoto->count() - 1 , citem ); } } -#if KDE_IS_VERSION(3,4,0) mainWidget->cmbPhotoUrl->setKURL(item->metaContact()->customPhoto().url()); -#else - mainWidget->cmbPhotoUrl->setURL(item->metaContact()->customPhoto().url()); -#endif Kopete::MetaContact::PropertySource photoSource = item->metaContact()->photoSource(); @@ -557,11 +553,7 @@ void KopeteMetaLVIProps::slotOpenSoundDialog( KURLRequester *requester ) void KopeteMetaLVIProps::slotClearPhotoClicked() { -#if KDE_IS_VERSION(3,4,0) mainWidget->cmbPhotoUrl->setKURL( KURL() ); -#else - mainWidget->cmbPhotoUrl->setURL( TQString() ); -#endif item->metaContact()->setPhoto( KURL() ); slotEnableAndDisableWidgets(); diff --git a/kopete/libkopete/Makefile.am b/kopete/libkopete/Makefile.am index 5b3d32fd..2d9c87f2 100644 --- a/kopete/libkopete/Makefile.am +++ b/kopete/libkopete/Makefile.am @@ -1,15 +1,9 @@ -if compile_LIBKOPETE_COMPAT -COMPAT_DIR = compat -COMPAT_LIBS = compat/libkopetecompat.la -endif - - include ../../admin/Doxyfile.am DOXYGEN_REFERENCES = tdeio tdecore tdeui DOXYGEN_EXCLUDE = compat DOXYGEN_SET_PROJECT_NAME = libkopete -SUBDIRS = $(COMPAT_DIR) private ui . avdevice +SUBDIRS = private ui . avdevice METASOURCES = AUTO @@ -35,7 +29,7 @@ libkopete_la_SOURCES = knotification.cpp connectionmanager.cpp kopeteonlinestatu kopeteprefs.cpp kopetepicture.cpp webcamwidget.cpp libkopete_la_LDFLAGS = -no-undefined -version-info 1:0:0 $(all_libraries) -libkopete_la_LIBADD = -ltdeabc ui/libkopeteui.la $(COMPAT_LIBS) $(LIB_TDEIO) $(LIB_XSS) $(LIB_XRENDER) +libkopete_la_LIBADD = -ltdeabc ui/libkopeteui.la $(LIB_TDEIO) $(LIB_XSS) $(LIB_XRENDER) kde_kcfg_DATA = kopete.kcfg diff --git a/kopete/libkopete/compat/Makefile.am b/kopete/libkopete/compat/Makefile.am deleted file mode 100644 index 27fc0805..00000000 --- a/kopete/libkopete/compat/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -METASOURCES = AUTO -AM_CPPFLAGS = $(KOPETE_INCLUDES) $(all_includes) -noinst_LTLIBRARIES = libkopetecompat.la - -libkopetecompat_la_SOURCES = kpixmapregionselectordialog.cpp kpixmapregionselectorwidget.cpp -libkopetecompat_la_LDFLAGS = -no-undefined $(all_libraries) -libkopetecompat_la_LIBADD = $(LIB_TDEUI) $(LIB_TDECORE) - diff --git a/kopete/libkopete/compat/kpixmapregionselectordialog.cpp b/kopete/libkopete/compat/kpixmapregionselectordialog.cpp deleted file mode 100644 index 8228cd2f..00000000 --- a/kopete/libkopete/compat/kpixmapregionselectordialog.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2004 Antonio Larrosa <larrosa@kde.org - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "kpixmapregionselectordialog.h" -#include <kdialogbase.h> -#include <tqdialog.h> -#include <tqdesktopwidget.h> -#include <tdelocale.h> -#include <kdialog.h> - -KPixmapRegionSelectorDialog::KPixmapRegionSelectorDialog(TQWidget *parent, - const char *name, bool modal ) : KDialogBase(parent, name, modal, i18n("Select Region of Image"), Help|Ok|Cancel, Ok, true ) -{ - TQVBox *vbox=new TQVBox(this); - new TQLabel(i18n("Please click and drag on the image to select the region of interest:"), vbox); - m_pixmapSelectorWidget= new KPixmapRegionSelectorWidget(vbox); - - vbox->setSpacing( KDialog::spacingHint() ); - - setMainWidget(vbox); -} - -KPixmapRegionSelectorDialog::~KPixmapRegionSelectorDialog() -{ -} - -TQRect KPixmapRegionSelectorDialog::getSelectedRegion(const TQPixmap &pixmap, TQWidget *parent ) -{ - KPixmapRegionSelectorDialog dialog(parent); - - dialog.pixmapRegionSelectorWidget()->setPixmap(pixmap); - - TQDesktopWidget desktopWidget; - TQRect screen=desktopWidget.availableGeometry(); - dialog.pixmapRegionSelectorWidget()->setMaximumWidgetSize( - (int)(screen.width()*4.0/5), (int)(screen.height()*4.0/5)); - - int result = dialog.exec(); - - TQRect rect; - - if ( result == TQDialog::Accepted ) - rect = dialog.pixmapRegionSelectorWidget()->unzoomedSelectedRegion(); - - return rect; -} - -TQRect KPixmapRegionSelectorDialog::getSelectedRegion(const TQPixmap &pixmap, int aspectRatioWidth, int aspectRatioHeight, TQWidget *parent ) -{ - KPixmapRegionSelectorDialog dialog(parent); - - dialog.pixmapRegionSelectorWidget()->setPixmap(pixmap); - dialog.pixmapRegionSelectorWidget()->setSelectionAspectRatio(aspectRatioWidth,aspectRatioHeight); - - TQDesktopWidget desktopWidget; - TQRect screen=desktopWidget.availableGeometry(); - dialog.pixmapRegionSelectorWidget()->setMaximumWidgetSize( - (int)(screen.width()*4.0/5), (int)(screen.height()*4.0/5)); - - int result = dialog.exec(); - - TQRect rect; - - if ( result == TQDialog::Accepted ) - rect = dialog.pixmapRegionSelectorWidget()->unzoomedSelectedRegion(); - - return rect; -} - -TQImage KPixmapRegionSelectorDialog::getSelectedImage(const TQPixmap &pixmap, TQWidget *parent ) -{ - KPixmapRegionSelectorDialog dialog(parent); - - dialog.pixmapRegionSelectorWidget()->setPixmap(pixmap); - - TQDesktopWidget desktopWidget; - TQRect screen=desktopWidget.availableGeometry(); - dialog.pixmapRegionSelectorWidget()->setMaximumWidgetSize( - (int)(screen.width()*4.0/5), (int)(screen.height()*4.0/5)); - int result = dialog.exec(); - - TQImage image; - - if ( result == TQDialog::Accepted ) - image = dialog.pixmapRegionSelectorWidget()->selectedImage(); - - return image; -} - -TQImage KPixmapRegionSelectorDialog::getSelectedImage(const TQPixmap &pixmap, int aspectRatioWidth, int aspectRatioHeight, TQWidget *parent ) -{ - KPixmapRegionSelectorDialog dialog(parent); - - dialog.pixmapRegionSelectorWidget()->setPixmap(pixmap); - dialog.pixmapRegionSelectorWidget()->setSelectionAspectRatio(aspectRatioWidth,aspectRatioHeight); - - TQDesktopWidget desktopWidget; - TQRect screen=desktopWidget.availableGeometry(); - dialog.pixmapRegionSelectorWidget()->setMaximumWidgetSize( - (int)(screen.width()*4.0/5), (int)(screen.height()*4.0/5)); - - int result = dialog.exec(); - - TQImage image; - - if ( result == TQDialog::Accepted ) - image = dialog.pixmapRegionSelectorWidget()->selectedImage(); - - return image; -} - diff --git a/kopete/libkopete/compat/kpixmapregionselectordialog.h b/kopete/libkopete/compat/kpixmapregionselectordialog.h deleted file mode 100644 index ffc5551e..00000000 --- a/kopete/libkopete/compat/kpixmapregionselectordialog.h +++ /dev/null @@ -1,107 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2004 Antonio Larrosa <larrosa@kde.org - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __KPIXMAPREGIONSELECTORDIALOG_H__ -#define __KPIXMAPREGIONSELECTORDIALOG_H__ - -#include <tqimage.h> - -#include <kdialogbase.h> -#include <kpixmapregionselectorwidget.h> - -/** - * A dialog that uses a KPixmapRegionSelectorWidget to allow the user - * to select a region of an image. If you want to use special features - * like forcing the selected area to have a fixed aspect ratio, you can use - * @see pixmapRegionSelectorWidget() to get the pointer to the - * KPixmapRegionSelectorWidget object and set the desired options there. - * - * There are some convenience methods that allow to easily show a dialog - * for the user to select a region of an image, and just care about the selected - * image. - * - * @author Antonio Larrosa <larrosa@kde.org> - * @since 3.4 - */ -class KOPETE_EXPORT KPixmapRegionSelectorDialog : public KDialogBase -{ -public: - /** - * The constructor of an empty KPixmapRegionSelectorDialog, you have to call - * later the setPixmap method of the KPixmapRegionSelectorWidget widget of - * the new object. - */ - KPixmapRegionSelectorDialog(TQWidget *parent=0L, const char *name=0L, - bool modal = false ); - /** - * The destructor of the dialog - */ - ~KPixmapRegionSelectorDialog(); - - /** - * @returns the KPixmapRegionSelectorWidget widget so that additional - * parameters can be set by using it. - */ - KPixmapRegionSelectorWidget *pixmapRegionSelectorWidget() const - { return m_pixmapSelectorWidget; }; - - /** - * Creates a modal dialog, lets the user to select a region of the @p pixmap - * and returns when the dialog is closed. - * - * @returns the selected rectangle, or an invalid rectangle if the user - * pressed the Cancel button. - */ - static TQRect getSelectedRegion(const TQPixmap &pixmap, TQWidget *parent = 0L ); - - /** - * Creates a modal dialog, lets the user to select a region of the @p pixmap - * with the same aspect ratio than @p aspectRatioWidth x @p aspectRatioHeight - * and returns when the dialog is closed. - * - * @returns the selected rectangle, or an invalid rectangle if the user - * pressed the Cancel button. - */ - static TQRect getSelectedRegion(const TQPixmap &pixmap, int aspectRatioWidth, int aspectRatioHeight, TQWidget *parent = 0L ); - - /** - * Creates a modal dialog, lets the user to select a region of the @p pixmap - * and returns when the dialog is closed. - * - * @returns the selected image, or an invalid image if the user - * pressed the Cancel button. - */ - static TQImage getSelectedImage(const TQPixmap &pixmap, TQWidget *parent = 0L ); - - /** - * Creates a modal dialog, lets the user to select a region of the @p pixmap - * with the same aspect ratio than @p aspectRatioWidth x @p aspectRatioHeight - * and returns when the dialog is closed. - * - * @returns the selected image, or an invalid image if the user - * pressed the Cancel button. - */ - static TQImage getSelectedImage(const TQPixmap &pixmap, int aspectRatioWidth, int aspectRatioHeight, TQWidget *parent = 0L ); - -protected: - KPixmapRegionSelectorWidget *m_pixmapSelectorWidget; -}; - - -#endif diff --git a/kopete/libkopete/compat/kpixmapregionselectorwidget.cpp b/kopete/libkopete/compat/kpixmapregionselectorwidget.cpp deleted file mode 100644 index 9dc4fb7d..00000000 --- a/kopete/libkopete/compat/kpixmapregionselectorwidget.cpp +++ /dev/null @@ -1,450 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2004 Antonio Larrosa <larrosa@kde.org - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -/* NOTE: There are two copies of this .h and the .cpp file, with subtle differences. - * One copy is in tdelibs/tdeui, and the other copy is in tdepim/libtdepim - * This is because tdepim has to remain backwards compatible. Any changes - * to either file should be made to the other. - */ - -#include "kpixmapregionselectorwidget.h" -#include <tqpainter.h> -#include <tqcolor.h> -#include <tqimage.h> -#include <tqlayout.h> -#include <kimageeffect.h> -#include <kdebug.h> -#include <tdelocale.h> -#include <tdepopupmenu.h> -#include <tdeaction.h> -#include <stdlib.h> -#include <tqcursor.h> -#include <tqapplication.h> - -KPixmapRegionSelectorWidget::KPixmapRegionSelectorWidget( TQWidget *parent, - const char *name) : TQWidget( parent, name) -{ - TQHBoxLayout * hboxLayout=new TQHBoxLayout( this ); - - hboxLayout->addStretch(); - TQVBoxLayout * vboxLayout=new TQVBoxLayout( hboxLayout ); - - vboxLayout->addStretch(); - m_label = new TQLabel(this, "pixmapHolder"); - m_label->setBackgroundMode( TQt::NoBackground ); - m_label->installEventFilter( this ); - - vboxLayout->addWidget(m_label); - vboxLayout->addStretch(); - - hboxLayout->addStretch(); - - m_forcedAspectRatio=0; - - m_zoomFactor=1.0; -} - -KPixmapRegionSelectorWidget::~KPixmapRegionSelectorWidget() -{ -} - -void KPixmapRegionSelectorWidget::setPixmap( const TQPixmap &pixmap ) -{ - Q_ASSERT(!pixmap.isNull()); //This class isn't designed to deal with null pixmaps. - m_originalPixmap = pixmap; - m_unzoomedPixmap = pixmap; - m_label->setPixmap( pixmap ); - resetSelection(); -} - -void KPixmapRegionSelectorWidget::resetSelection() -{ - m_selectedRegion = m_originalPixmap.rect(); - updatePixmap(); -} - -TQRect KPixmapRegionSelectorWidget::selectedRegion() const -{ - return m_selectedRegion; -} - -void KPixmapRegionSelectorWidget::setSelectedRegion(const TQRect &rect) -{ - if (!rect.isValid()) resetSelection(); - else - { - m_selectedRegion=rect; - updatePixmap(); - - TQRect r=unzoomedSelectedRegion(); - } -} - -void KPixmapRegionSelectorWidget::updatePixmap() -{ - Q_ASSERT(!m_originalPixmap.isNull()); if(m_originalPixmap.isNull()) { m_label->setPixmap(m_originalPixmap); return; } - if (m_selectedRegion.width()>m_originalPixmap.width()) m_selectedRegion.setWidth( m_originalPixmap.width() ); - if (m_selectedRegion.height()>m_originalPixmap.height()) m_selectedRegion.setHeight( m_originalPixmap.height() ); - - TQPainter painter; - if (m_linedPixmap.isNull()) - { - m_linedPixmap = m_originalPixmap; - - painter.begin(&m_linedPixmap); - painter.setRasterOp( TQt::XorROP ); - painter.fillRect(0,0,m_linedPixmap.width(), m_linedPixmap.height(), - TQBrush( TQColor(255,255,255), TQt::BDiagPattern) ); - painter.end(); - - TQImage image=m_linedPixmap.convertToImage(); - image=KImageEffect::fade(image, (float)0.4, TQColor(0,0,0)); - m_linedPixmap.convertFromImage(image); - } - - TQPixmap pixmap = m_linedPixmap; - - painter.begin(&pixmap); - painter.drawPixmap( m_selectedRegion.topLeft(), - m_originalPixmap, m_selectedRegion ); - - painter.setPen( TQColor(255,255,255) ); - painter.setRasterOp( TQt::XorROP ); - - painter.drawRect( m_selectedRegion ); - - painter.end(); - - m_label->setPixmap(pixmap); -} - - -TDEPopupMenu *KPixmapRegionSelectorWidget::createPopupMenu() -{ - TDEPopupMenu *popup=new TDEPopupMenu(this, "PixmapRegionSelectorPopup"); - popup->insertTitle(i18n("Image Operations")); - - TDEAction *action = new TDEAction(i18n("&Rotate Clockwise"), "object-rotate-right", - 0, this, TQ_SLOT(rotateClockwise()), - popup, "rotateclockwise"); - action->plug(popup); - - action = new TDEAction(i18n("Rotate &Counterclockwise"), "object-rotate-left", - 0, this, TQ_SLOT(rotateCounterclockwise()), - popup, "rotatecounterclockwise"); - action->plug(popup); - -/* - I wonder if it would be appropiate to have here an "Open with..." option to - edit the image (antlarr) -*/ - return popup; -} - -void KPixmapRegionSelectorWidget::rotate(KImageEffect::RotateDirection direction) -{ - int w=m_originalPixmap.width(); - int h=m_originalPixmap.height(); - TQImage img=m_unzoomedPixmap.convertToImage(); - img= KImageEffect::rotate(img, direction); - m_unzoomedPixmap.convertFromImage(img); - - img=m_originalPixmap.convertToImage(); - img= KImageEffect::rotate(img, direction); - m_originalPixmap.convertFromImage(img); - - m_linedPixmap=TQPixmap(); - - if (m_forcedAspectRatio>0 && m_forcedAspectRatio!=1) - resetSelection(); - else - { - switch (direction) - { - case ( KImageEffect::Rotate90 ): - { - int x=h-m_selectedRegion.y()-m_selectedRegion.height(); - int y=m_selectedRegion.x(); - m_selectedRegion.setRect(x, y, m_selectedRegion.height(), m_selectedRegion.width() ); - updatePixmap(); - } break; - case ( KImageEffect::Rotate270 ): - { - int x=m_selectedRegion.y(); - int y=w-m_selectedRegion.x()-m_selectedRegion.width(); - m_selectedRegion.setRect(x, y, m_selectedRegion.height(), m_selectedRegion.width() ); - updatePixmap(); - } break; - default: resetSelection(); - } - } -} - -void KPixmapRegionSelectorWidget::rotateClockwise() -{ - rotate(KImageEffect::Rotate90); -} - -void KPixmapRegionSelectorWidget::rotateCounterclockwise() -{ - rotate(KImageEffect::Rotate270); -} - -bool KPixmapRegionSelectorWidget::eventFilter(TQObject *obj, TQEvent *ev) -{ - if ( ev->type() == TQEvent::MouseButtonPress ) - { - TQMouseEvent *mev= (TQMouseEvent *)(ev); - //kdDebug() << TQString("click at %1,%2").arg( mev->x() ).arg( mev->y() ) << endl; - - if ( mev->button() == RightButton ) - { - TDEPopupMenu *popup = createPopupMenu( ); - popup->exec( mev->globalPos() ); - delete popup; - return true; - }; - - TQCursor cursor; - - if ( m_selectedRegion.contains( mev->pos() ) - && m_selectedRegion!=m_originalPixmap.rect() ) - { - m_state=Moving; - cursor.setShape( TQt::SizeAllCursor ); - } - else - { - m_state=Resizing; - cursor.setShape( TQt::CrossCursor ); - } - TQApplication::setOverrideCursor(cursor); - - m_tempFirstClick=mev->pos(); - - - return true; - } - - if ( ev->type() == TQEvent::MouseMove ) - { - TQMouseEvent *mev= (TQMouseEvent *)(ev); - - //kdDebug() << TQString("move to %1,%2").arg( mev->x() ).arg( mev->y() ) << endl; - - if ( m_state == Resizing ) - { - setSelectedRegion ( - calcSelectionRectangle( m_tempFirstClick, mev->pos() ) ); - } - else if (m_state == Moving ) - { - int mevx = mev->x(); - int mevy = mev->y(); - bool mouseOutside=false; - if ( mevx < 0 ) - { - m_selectedRegion.moveBy(-m_selectedRegion.x(),0); - mouseOutside=true; - } - else if ( mevx > m_originalPixmap.width() ) - { - m_selectedRegion.moveBy(m_originalPixmap.width()-m_selectedRegion.width()-m_selectedRegion.x(),0); - mouseOutside=true; - } - if ( mevy < 0 ) - { - m_selectedRegion.moveBy(0,-m_selectedRegion.y()); - mouseOutside=true; - } - else if ( mevy > m_originalPixmap.height() ) - { - m_selectedRegion.moveBy(0,m_originalPixmap.height()-m_selectedRegion.height()-m_selectedRegion.y()); - mouseOutside=true; - } - if (mouseOutside) { updatePixmap(); return true; }; - - m_selectedRegion.moveBy( mev->x()-m_tempFirstClick.x(), - mev->y()-m_tempFirstClick.y() ); - - // Check that the region has not fallen outside the image - if (m_selectedRegion.x() < 0) - m_selectedRegion.moveBy(-m_selectedRegion.x(),0); - else if (m_selectedRegion.right() > m_originalPixmap.width()) - m_selectedRegion.moveBy(-(m_selectedRegion.right()-m_originalPixmap.width()),0); - - if (m_selectedRegion.y() < 0) - m_selectedRegion.moveBy(0,-m_selectedRegion.y()); - else if (m_selectedRegion.bottom() > m_originalPixmap.height()) - m_selectedRegion.moveBy(0,-(m_selectedRegion.bottom()-m_originalPixmap.height())); - - m_tempFirstClick=mev->pos(); - updatePixmap(); - } - return true; - } - - if ( ev->type() == TQEvent::MouseButtonRelease ) - { - TQMouseEvent *mev= (TQMouseEvent *)(ev); - - if ( m_state == Resizing && mev->pos() == m_tempFirstClick) - resetSelection(); - - m_state=None; - TQApplication::restoreOverrideCursor(); - - return true; - } - - TQWidget::eventFilter(obj, ev); - return false; -} - -TQRect KPixmapRegionSelectorWidget::calcSelectionRectangle( const TQPoint & startPoint, const TQPoint & _endPoint ) -{ - TQPoint endPoint = _endPoint; - if ( endPoint.x() < 0 ) endPoint.setX(0); - else if ( endPoint.x() > m_originalPixmap.width() ) endPoint.setX(m_originalPixmap.width()); - if ( endPoint.y() < 0 ) endPoint.setY(0); - else if ( endPoint.y() > m_originalPixmap.height() ) endPoint.setY(m_originalPixmap.height()); - int w=abs(startPoint.x()-endPoint.x()); - int h=abs(startPoint.y()-endPoint.y()); - - if (m_forcedAspectRatio>0) - { - double aspectRatio=w/double(h); - - if (aspectRatio>m_forcedAspectRatio) - h=(int)(w/m_forcedAspectRatio); - else - w=(int)(h*m_forcedAspectRatio); - } - - int x,y; - if ( startPoint.x() < endPoint.x() ) - x=startPoint.x(); - else - x=startPoint.x()-w; - if ( startPoint.y() < endPoint.y() ) - y=startPoint.y(); - else - y=startPoint.y()-h; - - if (x<0) - { - w+=x; - x=0; - h=(int)(w/m_forcedAspectRatio); - - if ( startPoint.y() > endPoint.y() ) - y=startPoint.y()-h; - } - else if (x+w>m_originalPixmap.width()) - { - w=m_originalPixmap.width()-x; - h=(int)(w/m_forcedAspectRatio); - - if ( startPoint.y() > endPoint.y() ) - y=startPoint.y()-h; - } - if (y<0) - { - h+=y; - y=0; - w=(int)(h*m_forcedAspectRatio); - - if ( startPoint.x() > endPoint.x() ) - x=startPoint.x()-w; - } - else if (y+h>m_originalPixmap.height()) - { - h=m_originalPixmap.height()-y; - w=(int)(h*m_forcedAspectRatio); - - if ( startPoint.x() > endPoint.x() ) - x=startPoint.x()-w; - } - - return TQRect(x,y,w,h); -} - -TQRect KPixmapRegionSelectorWidget::unzoomedSelectedRegion() const -{ - return TQRect((int)(m_selectedRegion.x()/m_zoomFactor), - (int)(m_selectedRegion.y()/m_zoomFactor), - (int)(m_selectedRegion.width()/m_zoomFactor), - (int)(m_selectedRegion.height()/m_zoomFactor)); -} - -TQImage KPixmapRegionSelectorWidget::selectedImage() const -{ - TQImage origImage=m_unzoomedPixmap.convertToImage(); - return origImage.copy(unzoomedSelectedRegion()); -} - -void KPixmapRegionSelectorWidget::setSelectionAspectRatio(int width, int height) -{ - m_forcedAspectRatio=width/double(height); -} - -void KPixmapRegionSelectorWidget::setFreeSelectionAspectRatio() -{ - m_forcedAspectRatio=0; -} - -void KPixmapRegionSelectorWidget::setMaximumWidgetSize(int width, int height) -{ - m_maxWidth=width; - m_maxHeight=height; - - m_originalPixmap=m_unzoomedPixmap; - if (m_selectedRegion == m_originalPixmap.rect()) m_selectedRegion=TQRect(); - -// kdDebug() << TQString(" original Pixmap :") << m_originalPixmap.rect() << endl; -// kdDebug() << TQString(" unzoomed Pixmap : %1 x %2 ").arg(m_unzoomedPixmap.width()).arg(m_unzoomedPixmap.height()) << endl; - - if ( !m_originalPixmap.isNull() && - ( m_originalPixmap.width() > m_maxWidth || - m_originalPixmap.height() > m_maxHeight ) ) - { - /* We have to resize the pixmap to get it complete on the screen */ - TQImage image=m_originalPixmap.convertToImage(); - m_originalPixmap.convertFromImage( image.smoothScale( width, height, TQImage::ScaleMin ) ); - double oldZoomFactor = m_zoomFactor; - m_zoomFactor=m_originalPixmap.width()/(double)m_unzoomedPixmap.width(); - - if (m_selectedRegion.isValid()) - { - m_selectedRegion= - TQRect((int)(m_selectedRegion.x()*m_zoomFactor/oldZoomFactor), - (int)(m_selectedRegion.y()*m_zoomFactor/oldZoomFactor), - (int)(m_selectedRegion.width()*m_zoomFactor/oldZoomFactor), - (int)(m_selectedRegion.height()*m_zoomFactor/oldZoomFactor) ); - } - } - - if (!m_selectedRegion.isValid()) m_selectedRegion = m_originalPixmap.rect(); - - m_linedPixmap=TQPixmap(); - updatePixmap(); - resize(m_label->width(), m_label->height()); -} - -#include "kpixmapregionselectorwidget.moc" diff --git a/kopete/libkopete/compat/kpixmapregionselectorwidget.h b/kopete/libkopete/compat/kpixmapregionselectorwidget.h deleted file mode 100644 index d99fdfcb..00000000 --- a/kopete/libkopete/compat/kpixmapregionselectorwidget.h +++ /dev/null @@ -1,171 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2004 Antonio Larrosa <larrosa@kde.org - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __KPIXMAPREGIONSELECTORWIDGET_H__ -#define __KPIXMAPREGIONSELECTORWIDGET_H__ -#include <tqvbox.h> -#include <tqpixmap.h> -#include <tqrect.h> -#include <tqlabel.h> -#include <kimageeffect.h> - -class TDEPopupMenu; - -#include "kopete_export.h" - -/** - * KPixmapRegionSelectorWidget is a widget that shows a picture and provides the - * user with a friendly way to select a rectangular subregion of the pixmap. - * - * NOTE: There are two copies of this .h and the .cpp file, with subtle differences. - * One copy is in tdelibs/tdeui, and the other copy is in tdepim/libtdepim - * This is because tdepim has to remain backwards compatible. Any changes - * to either file should be made to the other. - * - * @author Antonio Larrosa <larrosa@kde.org> - * @since 3.4 - */ -class KOPETE_EXPORT KPixmapRegionSelectorWidget : public TQWidget -{ - TQ_OBJECT - -public: - /** - * Constructor for a KPixmapRegionSelectorWidget. - */ - KPixmapRegionSelectorWidget( TQWidget *parent = 0L, const char *name=0L); - - /** - * Destructor for a KPixmapRegionSelectorWidget - */ - ~KPixmapRegionSelectorWidget(); - - /** - * Sets the pixmap which will be shown for the user to select a region from. - * @param pixmap The pixmap. Must be non-null. - * - */ - void setPixmap( const TQPixmap &pixmap ); - - /** - * @return the original whole pixmap that we're using in this widget as the - * pixmap the user is selecting a region from. - */ - TQPixmap pixmap() const { return m_unzoomedPixmap; }; - - /** - * Sets the selected region to be @p rect (in zoomed pixmap coordinates) - */ - void setSelectedRegion(const TQRect &rect); - - /** - * Returns the selected region ( in zoomed pixmap coordinates ) - */ - TQRect selectedRegion() const; - - /** - * Returns the selected region ( in unzoomed, original pixmap coordinates ) - */ - TQRect unzoomedSelectedRegion() const; - - /** - * Resets the selection to use the whole image - */ - void resetSelection(); - - /** - * @returns a TQImage object with just the region the user selected from the - * image - */ - TQImage selectedImage() const; - - /** - * Sets the aspect ration that the selected subimage should have. The way to - * select it, is specifying an example valid @p width and @p height. - * @see setFreeSelectionAspectRatio() - */ - void setSelectionAspectRatio(int width, int height); - - /** - * Allows the user to do a selection which has any aspect ratio. This is - * the default. - * @see setSelectionAspectRatio() - */ - void setFreeSelectionAspectRatio(); - - /** - * Sets the maximum size for the widget. If the image is larger than this - * (either horizontally or vertically), it's scaled to adjust to the maximum - * size (preserving the aspect ratio) - */ - void setMaximumWidgetSize( int width, int height ); - - /** - * Rotates the image as specified by the @p direction parameter, also tries - * to rotate the selected region so that it doesn't change, as long as the - * forced aspect ratio setting is respected, in other case, the selected region - * is resetted. - */ - void rotate(KImageEffect::RotateDirection direction); - -public slots: - /** - * Rotates the current image 90º clockwise - */ - void rotateClockwise(); - /** - * Rotates the current image 90º counterclockwise - */ - void rotateCounterclockwise(); - -protected: - /** - * Creates a TDEPopupMenu with the menu that appears when clicking with the right button on the label - */ - virtual TDEPopupMenu *createPopupMenu(); - -private: - bool eventFilter(TQObject *obj, TQEvent *ev); - - /** - * Recalculates the pixmap that is shown based on the current selected area, - * the original image, etc. - */ - void updatePixmap(); - - TQRect calcSelectionRectangle( const TQPoint &startPoint, const TQPoint & endPoint ); - - enum CursorState { None=0, Resizing, Moving }; - CursorState m_state; - - TQPixmap m_unzoomedPixmap; - TQPixmap m_originalPixmap; - TQPixmap m_linedPixmap; - TQRect m_selectedRegion; - TQLabel *m_label; - - TQPoint m_tempFirstClick; - double m_forcedAspectRatio; - - int m_maxWidth, m_maxHeight; - double m_zoomFactor; -}; - -#endif - diff --git a/kopete/libkopete/kautoconfig.cpp b/kopete/libkopete/kautoconfig.cpp index 99e7d51c..692fcecb 100644 --- a/kopete/libkopete/kautoconfig.cpp +++ b/kopete/libkopete/kautoconfig.cpp @@ -214,22 +214,18 @@ bool KAutoConfig::saveSettings() { ++it; TQVariant defaultValue = d->defaultValues[groupWidget]; TQVariant currentValue = propertyMap->property(groupWidget); -#if KDE_IS_VERSION( 3, 1, 90 ) if(!config->hasDefault(TQString::fromLatin1(groupWidget->name())) && currentValue == defaultValue){ config->revertToDefault(TQString::fromLatin1(groupWidget->name())); widgetChanged = true; } else{ -#endif TQVariant savedValue = config->readPropertyEntry(groupWidget->name(), defaultValue); if(savedValue != currentValue){ config->writeEntry(groupWidget->name(), currentValue); widgetChanged = true; } -#if KDE_IS_VERSION( 3, 1, 90 ) } -#endif } d->changed |= widgetChanged; if(widgetChanged) diff --git a/kopete/libkopete/kopete_export.h b/kopete/libkopete/kopete_export.h index 54d7afb0..a453a792 100644 --- a/kopete/libkopete/kopete_export.h +++ b/kopete/libkopete/kopete_export.h @@ -19,12 +19,7 @@ #define KOPETE_EXPORT_H #include <tdemacros.h> -#include <tdeversion.h> -#if KDE_IS_VERSION(3,3,2) #define KOPETE_EXPORT TDE_EXPORT -#else -#define KOPETE_EXPORT -#endif #endif diff --git a/kopete/plugins/alias/Makefile.am b/kopete/plugins/alias/Makefile.am index d49f5ed6..f8465016 100644 --- a/kopete/plugins/alias/Makefile.am +++ b/kopete/plugins/alias/Makefile.am @@ -9,7 +9,7 @@ kopete_alias_la_LIBADD = ../../libkopete/libkopete.la kcm_kopete_alias_la_SOURCES = aliaspreferences.cpp aliasdialogbase.ui aliasdialog.ui editaliasdialog.cpp kcm_kopete_alias_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) $(all_libraries) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -kcm_kopete_alias_la_LIBADD = $(LIB_KOPETECOMPAT) $(LIB_TDEUTILS) ../../libkopete/libkopete.la +kcm_kopete_alias_la_LIBADD = $(LIB_TDEUTILS) ../../libkopete/libkopete.la service_DATA = kopete_alias.desktop servicedir = $(kde_servicesdir) diff --git a/kopete/plugins/highlight/Makefile.am b/kopete/plugins/highlight/Makefile.am index 1075b5f7..2d167288 100644 --- a/kopete/plugins/highlight/Makefile.am +++ b/kopete/plugins/highlight/Makefile.am @@ -12,7 +12,7 @@ kopete_highlight_la_LIBADD = ../../libkopete/libkopete.la kcm_kopete_highlight_la_SOURCES = highlightprefsbase.ui highlightpreferences.cpp filter.cpp highlightconfig.cpp kcm_kopete_highlight_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) $(all_libraries) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -kcm_kopete_highlight_la_LIBADD = $(LIB_KOPETECOMPAT) $(LIB_TDEUTILS) +kcm_kopete_highlight_la_LIBADD = $(LIB_TDEUTILS) service_DATA = kopete_highlight.desktop servicedir = $(kde_servicesdir) diff --git a/kopete/plugins/latex/Makefile.am b/kopete/plugins/latex/Makefile.am index f3a94679..bebf17cf 100644 --- a/kopete/plugins/latex/Makefile.am +++ b/kopete/plugins/latex/Makefile.am @@ -12,7 +12,7 @@ kopete_latex_la_LIBADD = ../../libkopete/libkopete.la kcm_kopete_latex_la_SOURCES = latexprefsbase.ui latexpreferences.cpp latexconfig.kcfgc kcm_kopete_latex_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) $(all_libraries) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -kcm_kopete_latex_la_LIBADD = $(LIB_KOPETECOMPAT) $(LIB_TDEUTILS) +kcm_kopete_latex_la_LIBADD = $(LIB_TDEUTILS) service_DATA = kopete_latex.desktop servicedir = $(kde_servicesdir) diff --git a/kopete/plugins/motionautoaway/Makefile.am b/kopete/plugins/motionautoaway/Makefile.am index 2b349ca4..8ed5d3d8 100644 --- a/kopete/plugins/motionautoaway/Makefile.am +++ b/kopete/plugins/motionautoaway/Makefile.am @@ -10,7 +10,7 @@ kopete_motionaway_la_LIBADD = ../../libkopete/libkopete.la kcm_kopete_motionaway_la_SOURCES = motionawayprefs.ui motionawaypreferences.cpp motionawayconfig.kcfgc kcm_kopete_motionaway_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) $(all_libraries) -kcm_kopete_motionaway_la_LIBADD = $(LIB_KOPETECOMPAT) $(LIB_TDEUTILS) +kcm_kopete_motionaway_la_LIBADD = $(LIB_TDEUTILS) diff --git a/kopete/plugins/netmeeting/Makefile.am b/kopete/plugins/netmeeting/Makefile.am index 54b08a5b..3e89d265 100644 --- a/kopete/plugins/netmeeting/Makefile.am +++ b/kopete/plugins/netmeeting/Makefile.am @@ -16,7 +16,7 @@ mydata_DATA = netmeetingchatui.rc kcm_kopete_netmeeting_la_SOURCES = netmeetingprefs_ui.ui netmeetingpreferences.cpp kcm_kopete_netmeeting_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -kcm_kopete_netmeeting_la_LIBADD = $(LIB_KOPETECOMPAT) $(LIB_TDEUTILS) +kcm_kopete_netmeeting_la_LIBADD = $(LIB_TDEUTILS) kcm_DATA = kopete_netmeeting_config.desktop diff --git a/kopete/plugins/nowlistening/Makefile.am b/kopete/plugins/nowlistening/Makefile.am index 60ca64e2..b18c8b6c 100644 --- a/kopete/plugins/nowlistening/Makefile.am +++ b/kopete/plugins/nowlistening/Makefile.am @@ -10,7 +10,7 @@ kopete_nowlistening_la_LIBADD = ../../libkopete/libkopete.la kcm_kopete_nowlistening_la_SOURCES = nowlisteningprefs.ui nowlisteningpreferences.cpp nowlisteningconfig.kcfgc kcm_kopete_nowlistening_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) $(all_libraries) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -kcm_kopete_nowlistening_la_LIBADD = $(LIB_KOPETECOMPAT) $(LIB_TDEUTILS) +kcm_kopete_nowlistening_la_LIBADD = $(LIB_TDEUTILS) service_DATA = kopete_nowlistening.desktop servicedir = $(kde_servicesdir) diff --git a/kopete/plugins/translator/translatorplugin.cpp b/kopete/plugins/translator/translatorplugin.cpp index dc94304d..3e640ebc 100644 --- a/kopete/plugins/translator/translatorplugin.cpp +++ b/kopete/plugins/translator/translatorplugin.cpp @@ -44,12 +44,8 @@ #include "translatorlanguages.h" typedef KGenericFactory<TranslatorPlugin> TranslatorPluginFactory; -#if KDE_IS_VERSION(3,2,90) static const TDEAboutData aboutdata("kopete_translator", I18N_NOOP("Translator") , "1.0" ); K_EXPORT_COMPONENT_FACTORY( kopete_translator, TranslatorPluginFactory( &aboutdata ) ) -#else -K_EXPORT_COMPONENT_FACTORY( kopete_translator, TranslatorPluginFactory( "kopete_translator" ) ) -#endif TranslatorPlugin::TranslatorPlugin( TQObject *parent, const char *name, const TQStringList & /* args */ ) : Kopete::Plugin( TranslatorPluginFactory::instance(), parent, name ) diff --git a/kopete/protocols/irc/ircguiclient.cpp b/kopete/protocols/irc/ircguiclient.cpp index 9ce7f73a..757c8188 100644 --- a/kopete/protocols/irc/ircguiclient.cpp +++ b/kopete/protocols/irc/ircguiclient.cpp @@ -16,20 +16,7 @@ #include <tdelocale.h> -#include <tdeversion.h> -#if KDE_IS_VERSION( 3, 1, 90 ) - #include <tdeactioncollection.h> -#else -// ------------------------------------------------------------ -// TODO: UGLY HACK, remove when we drop KDE 3.1 compatibility -#ifdef KDE_NO_COMPAT -#undef KDE_NO_COMPAT -#include <tdeaction.h> -#define KDE_NO_COMPAT 1 -#endif -// ------------------------------------------------------------ -#endif - +#include <tdeactioncollection.h> #include <tqptrlist.h> #include <kdebug.h> #include <tqdom.h> diff --git a/kopete/protocols/irc/kcodecaction.h b/kopete/protocols/irc/kcodecaction.h index f0f03400..8db59104 100644 --- a/kopete/protocols/irc/kcodecaction.h +++ b/kopete/protocols/irc/kcodecaction.h @@ -17,14 +17,8 @@ #ifndef KCODECACTION_H #define KCODECACTION_H -#include <tdeversion.h> #include <tqintdict.h> - -#if KDE_IS_VERSION( 3, 1, 90 ) - #include <tdeactionclasses.h> -#else - #include <tdeaction.h> -#endif +#include <tdeactionclasses.h> class KCodecAction : public TDESelectAction { diff --git a/kopete/protocols/msn/msnprotocol.cpp b/kopete/protocols/msn/msnprotocol.cpp index 2b7e8ab6..fdedd147 100644 --- a/kopete/protocols/msn/msnprotocol.cpp +++ b/kopete/protocols/msn/msnprotocol.cpp @@ -23,7 +23,6 @@ #include <kdebug.h> #include <kgenericfactory.h> #include <tdeconfig.h> -#include <tdeversion.h> #include <tdeaboutdata.h> #include "kopeteaccountmanager.h" @@ -38,12 +37,8 @@ #include "msnchatsession.h" typedef KGenericFactory<MSNProtocol> MSNProtocolFactory; -#if KDE_IS_VERSION(3,2,90) static const TDEAboutData aboutdata("kopete_msn", I18N_NOOP("MSN Messenger") , "1.0" ); K_EXPORT_COMPONENT_FACTORY( libkopete_msn_shared, MSNProtocolFactory( &aboutdata ) ) -#else -K_EXPORT_COMPONENT_FACTORY( libkopete_msn_shared, MSNProtocolFactory( "kopete_msn" ) ) -#endif MSNProtocol *MSNProtocol::s_protocol = 0L; diff --git a/ksirc/displayMgrMDI.cpp b/ksirc/displayMgrMDI.cpp index 9383cf5f..a4d7035c 100644 --- a/ksirc/displayMgrMDI.cpp +++ b/ksirc/displayMgrMDI.cpp @@ -135,11 +135,7 @@ void DisplayMgrMDI::raise(TQWidget *w, bool takefocus) m_topLevel->show(); m_topLevel->raise(); m_topLevel->setActiveWindow(); -#if KDE_IS_VERSION(3,1,92) KWin::activateWindow(m_topLevel->winId()); -#else - KWin::setActiveWindow(m_topLevel->winId()); -#endif } m_topLevel->tabWidget()->showPage( w ); } diff --git a/ksirc/dockservercontroller.cpp b/ksirc/dockservercontroller.cpp index 467f573d..83b0f8e3 100644 --- a/ksirc/dockservercontroller.cpp +++ b/ksirc/dockservercontroller.cpp @@ -82,11 +82,7 @@ dockServerController::dockServerController(servercontroller *sc, TQWidget *paren pop->insertItem(i18n("&Do Autoconnect..."), m_sc, TQ_SLOT(start_autoconnect_check())); connect(this, TQ_SIGNAL(quitSelected()), m_sc, TQ_SLOT(endksirc())); -#if KDE_IS_VERSION(3,1,92) m_pic_dock = KSystemTray::loadIcon( "ksirc" ); -#else - m_pic_dock = UserIcon("ksirc_dock"); -#endif m_pic_info = UserIcon("application-vnd.tde.info"); if ( !m_pic_dock.isNull() ) diff --git a/ksirc/ksopts.cpp b/ksirc/ksopts.cpp index ea1ac59e..057da43b 100644 --- a/ksirc/ksopts.cpp +++ b/ksirc/ksopts.cpp @@ -1,14 +1,7 @@ #include <tdeapplication.h> #include <tdeconfig.h> - -#if KDE_IS_VERSION(3,1,92) #include <kuser.h> -#else -#include <unistd.h> -#include <pwd.h> -#endif - #include <kdebug.h> #include "ksopts.h" @@ -54,20 +47,10 @@ KSOStartup::KSOStartup() KSOServer::KSOServer() { -#if KDE_IS_VERSION(3,1,92) KUser user; nick = user.loginName(); userID = user.loginName(); realName = user.fullName(); -#else - struct passwd *pw = getpwuid( getuid() ); - if ( pw ) - { - nick = TQString::fromLocal8Bit( pw->pw_name ); - userID = TQString::fromLocal8Bit( pw->pw_name ); - realName = TQString::fromLocal8Bit( pw->pw_gecos ).section( ',', 0, 0 ); - } -#endif } diff --git a/ksirc/kstextview.cpp b/ksirc/kstextview.cpp index b6062b25..4a988956 100644 --- a/ksirc/kstextview.cpp +++ b/ksirc/kstextview.cpp @@ -1989,11 +1989,7 @@ void TextView::startDrag() TQDragObject *TextView::dragObject( const TQString &dragURL ) { -#if KDE_IS_VERSION(3,1,92) return new KURLDrag( KURL( dragURL ), viewport() ); -#else - return KURLDrag::newDrag( KURL( dragURL ), viewport() ); -#endif } void TextView::autoScroll() diff --git a/ksirc/toplevel.cpp b/ksirc/toplevel.cpp index e3eb564c..1296ea73 100644 --- a/ksirc/toplevel.cpp +++ b/ksirc/toplevel.cpp @@ -237,11 +237,7 @@ KSircTopLevel::KSircTopLevel(KSircProcess *_proc, const KSircChannel &channelInf TQCString kstn = TQCString(this->name()) + "_"; pan = new TQSplitter(TQt::Horizontal, top, kstn + "splitter"); -#if KDE_IS_VERSION(3,1,92) pan->setOpaqueResize( TDEGlobalSettings::opaqueResize() ); -#else - pan->setOpaqueResize( true ); -#endif mainw = new KSircView(ksircProcess(), pan, kstn + "KSircView" ); mainw->setFocusPolicy(TQWidget::NoFocus); @@ -1671,11 +1667,7 @@ void KSircTopLevel::saveCurrLog() *str << mainw->plainText(); temp.close(); -#if KDE_IS_VERSION(3,1,92) TDEIO::NetAccess::upload(temp.name(), url, this); -#else - TDEIO::NetAccess::upload(temp.name(), url); -#endif } |
