summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventviewer.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp37
1 files changed, 21 insertions, 16 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index c0acf34..4df26a9 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -16,14 +16,19 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <qcstring.h>
-#include <qwhatsthis.h>
+#include <q3cstring.h>
+#include <q3whatsthis.h>
#include <qdialog.h>
#include <qapplication.h>
+#include <QDesktopWidget>
#include <qlabel.h>
#include <qlayout.h>
+//Added by qt3to4:
+#include <QKeyEvent>
+#include <Q3PtrList>
+#include <Q3VBoxLayout>
#include <klocale.h>
#include <kapplication.h>
#include <libkcal/event.h>
@@ -54,16 +59,16 @@
#include <kabc/addresseedialog.h>
#include <kabc/addresseeview.h>
#include <qprinter.h>
#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
+#include <q3paintdevicemetrics.h>
#else //DESKTOP_VERSION
#include <qtopia/qcopenvelope_qws.h>
#endif //DESKTOP_VERSION
#include <externalapphandler.h>
KOEventViewer::KOEventViewer(QWidget *parent,const char *name)
- : QTextBrowser(parent,name)
+ : Q3TextBrowser(parent,name)
{
mSyncMode = false;
mColorMode = 0;
}
@@ -85,9 +90,9 @@ void KOEventViewer::printMe()
if (!printer.setup() )
return;
QPainter p;
p.begin ( &printer );
- QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
+ Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer );
float dx, dy;
int wid = (m.width() * 9)/10;
dx = (float) wid/(float)contentsWidth ();
dy = (float)(m.height()) / (float)contentsHeight ();
@@ -133,9 +138,9 @@ void KOEventViewer::setSource(const QString& n)
if (n == uid ) {
//qDebug("found %s ",(*it).mobileHomePhone().latin1() );
QDialog dia( this,"dia123", true );
dia.setCaption( i18n("Details of attendee") );
- QVBoxLayout lay ( &dia );
+ Q3VBoxLayout lay ( &dia );
KABC::AddresseeView av ( &dia );
av.setAddressee( (*it) );
lay.addWidget( &av );
if ( QApplication::desktop()->width() < 480 )
@@ -154,9 +159,9 @@ void KOEventViewer::setSource(const QString& n)
if ( "uid:organizer" == n ) {
ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),"");
return;
}
- QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
+ Q3PtrList<Attendee> attendees = mCurrentIncidence->attendees();
if (attendees.count()) {
Attendee *a;
for(a=attendees.first();a;a=attendees.next()) {
if ( "uid:"+a->uid() == n ) {
@@ -199,16 +204,16 @@ void KOEventViewer::setSource(const QString& n)
DCOPClient *client = KApplication::kApplication()->dcopClient();
const QByteArray noParamData;
const QByteArray paramData;
QByteArray replyData;
- QCString replyTypeStr;
+ Q3CString replyTypeStr;
#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData))
bool foundAbbrowser = PING_ABBROWSER;
if (foundAbbrowser) {
//KAddressbook is already running, so just DCOP to it to bring up the contact editor
//client->send("kaddressbook","KAddressBookIface",
- QDataStream arg(paramData, IO_WriteOnly);
+ QDataStream arg(paramData, QIODevice::WriteOnly);
arg << n.mid(6);
client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData);
return;
} else {
@@ -230,9 +235,9 @@ void KOEventViewer::setSource(const QString& n)
#endif
}
void KOEventViewer::mailToAttendees( bool all )
{
- QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
+ Q3PtrList<Attendee> attendees = mCurrentIncidence->attendees();
if (attendees.count() == 0) return;
QStringList nameList;
QStringList emailList;
QStringList uidList;
@@ -259,9 +264,9 @@ void KOEventViewer::mailToAttendees( bool all )
}
void KOEventViewer::addTag(const QString & tag,const QString & text)
{
- int number=text.contains("\n");
+ int number=text.count("\n");
QString str = "<" + tag + ">";
QString tmpText=text;
QString tmpStr=str;
if(number !=-1)
@@ -586,9 +591,9 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
mText += "</a><br>";
// mText.append(deTag("[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] " +event->relatedTo()->summary()) +"<br>");
}
- QPtrList<Incidence> Relations = event->relations();
+ Q3PtrList<Incidence> Relations = event->relations();
Incidence *to;
if ( Relations.first() )
addTag("b",i18n("Sub todos:<br>"));
for (to=Relations.first();to;to=Relations.next()) {
@@ -620,9 +625,9 @@ void KOEventViewer::formatCategories(Incidence *event)
}
}
void KOEventViewer::formatAttendees(Incidence *event)
{
- QPtrList<Attendee> attendees = event->attendees();
+ Q3PtrList<Attendee> attendees = event->attendees();
if (attendees.count()) {
QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
@@ -653,9 +658,9 @@ void KOEventViewer::formatAttendees(Incidence *event)
#else
mText.append(event->organizer());
#endif
- if (iconPath) {
+ if (!iconPath.isEmpty()) {
mText += " <a href=\"mailto:" + event->organizer() + "\">";
mText += "<IMG src=\"" + iconPath + "\">";
mText += "</a>\n";
}
@@ -703,9 +708,9 @@ void KOEventViewer::formatAttendees(Incidence *event)
#endif
if (!a->email().isEmpty()) {
- if (iconPath) {
+ if (!iconPath.isEmpty()) {
mText += "<a href=\"mailto:" + a->realName() +" <" + a->email() + ">:" + mMailSubject + "\">";
if ( a->RSVP() ) {
++a_count_nr;
mText += "<IMG src=\"" + iconPath + "\">";
@@ -861,8 +866,8 @@ void KOEventViewer::keyPressEvent ( QKeyEvent * e )
case Qt::Key_Enter :
e->ignore();
break;
default:
- QTextBrowser::keyPressEvent ( e );
+ Q3TextBrowser::keyPressEvent ( e );
break;
}
}