Diffstat (limited to 'korganizer/kowhatsnextview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index f88403c..bfe930f 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -15,20 +15,26 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <qlayout.h> -#include <qtextbrowser.h> +#include <q3textbrowser.h> #include <qtextcodec.h> #include <qfileinfo.h> #include <qlabel.h> #include <qapplication.h> +#include <QDesktopWidget> #ifdef DESKTOP_VERSION -#include <qpaintdevicemetrics.h> +#include <q3paintdevicemetrics.h> +//Added by qt3to4: +#include <Q3PtrList> +#include <QHideEvent> +#include <Q3VBoxLayout> +#include <QShowEvent> #endif #include <kglobal.h> #include <klocale.h> #include <kdebug.h> #include <kiconloader.h> #include <kmessagebox.h> @@ -39,13 +45,13 @@ #include "calprinter.h" #endif #include "koglobals.h" #include "koprefs.h" #include "koeventviewerdialog.h" #include "koeventviewer.h" -#include <qstylesheet.h> +#include <q3stylesheet.h> #include "kowhatsnextview.h" using namespace KOrg; void WhatsNextTextBrowser::setSource(const QString& n) { @@ -53,13 +59,13 @@ void WhatsNextTextBrowser::setSource(const QString& n) emit showIncidence(n); return; } else if (n.startsWith("todo:")) { emit showIncidence(n); return; } else { - QTextBrowser::setSource(n); + Q3TextBrowser::setSource(n); } } void WhatsNextTextBrowser::printMe() { #ifdef DESKTOP_VERSION KOPrintPrefs pp ( this ); @@ -69,13 +75,13 @@ void WhatsNextTextBrowser::printMe() QPrinter printer; 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 (); float scale; // scale to fit the width or height of the paper @@ -100,25 +106,25 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this); // mDateLabel->setMargin(2); // mDateLabel->setAlignment(AlignCenter); setFont( KOPrefs::instance()->mWhatsNextFont ); mView = new WhatsNextTextBrowser(this); connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); - QStyleSheet* stsh = mView->styleSheet(); - QStyleSheetItem * style ; + Q3StyleSheet* stsh = mView->styleSheet(); + Q3StyleSheetItem * style ; style = stsh->item ("h2" ); if ( style ) { - style->setMargin(QStyleSheetItem::MarginAll,0); + style->setMargin(Q3StyleSheetItem::MarginAll,0); } style = stsh->item ("h3" ); if ( style ) { - style->setMargin(QStyleSheetItem::MarginAll,0); + style->setMargin(Q3StyleSheetItem::MarginAll,0); } mEventViewer = 0; - QBoxLayout *topLayout = new QVBoxLayout(this); + Q3BoxLayout *topLayout = new Q3VBoxLayout(this); // topLayout->addWidget(mDateLabel); topLayout->addWidget(mView); mTimer = new QTimer( this ); connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView())); connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); @@ -141,15 +147,15 @@ int KOWhatsNextView::currentDateCount() void KOWhatsNextView::clearList() { mTimer->stop(); mView->setText(" "); } -QPtrList<Incidence> KOWhatsNextView::selectedIncidences() +Q3PtrList<Incidence> KOWhatsNextView::selectedIncidences() { - QPtrList<Incidence> eventList; + Q3PtrList<Incidence> eventList; return eventList; } void KOWhatsNextView::printMe() { @@ -216,14 +222,14 @@ void KOWhatsNextView::updateView() #else mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>"; #endif mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; int iii; mTodos.clear(); - QPtrList<Event> events; - QPtrList<Todo> todos = calendar()->todos(); + Q3PtrList<Event> events; + Q3PtrList<Todo> todos = calendar()->todos(); Todo * todo; //mText += "<h2>" + i18n("Events: ") + "</h2>\n"; int daysToShow = KOPrefs::instance()->mWhatsNextDays ; bool itemAdded = false; for ( iii = 0; iii < daysToShow; ++iii ) { QString date; @@ -451,13 +457,13 @@ void KOWhatsNextView::appendDay( int i, QDate eventDate ) void KOWhatsNextView::showDates(const QDate &, const QDate &) { updateView(); } -void KOWhatsNextView::showEvents(QPtrList<Event>) +void KOWhatsNextView::showEvents(Q3PtrList<Event>) { } void KOWhatsNextView::changeEventDisplay(Event *, int action) { switch(action) { @@ -738,13 +744,13 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) mText += "</p>\n"; } else { ind += "-"; mText += "</li>\n"; } - QPtrList<Incidence> Relations = ev->relations(); + Q3PtrList<Incidence> Relations = ev->relations(); Incidence *to; for (to=Relations.first();to;to=Relations.next()) { if (!((Todo*)to)->isCompleted() && ((Todo*)to)->priority() <= mCurrentMaxPrio ) appendTodo( to, ind , true ); } |