@ -19,14 +19,14 @@
# include <stdio.h>
# include <assert.h>
# include < qdir.h>
# include < qdesktopwidget.h>
# include < qdialog.h>
# include < qglobal.h>
# include < qkeycode.h>
# include < qlayout.h>
# include < qsize.h>
# include < qstring.h>
# include < t qdir.h>
# include < t qdesktopwidget.h>
# include < t qdialog.h>
# include < t qglobal.h>
# include < t qkeycode.h>
# include < t qlayout.h>
# include < t qsize.h>
# include < t qstring.h>
# include <kaboutdata.h>
# include <kaccel.h>
@ -89,7 +89,7 @@ KuickData* kdata;
static const int URL_ITEM = 0 ;
static const int META_ITEM = 1 ;
QValueList< ImageWindow * > KuickShow : : s_viewers ;
T QValueList< ImageWindow * > KuickShow : : s_viewers ;
KuickShow : : KuickShow ( const char * name )
: KMainWindow ( 0L , name ) ,
@ -110,8 +110,8 @@ KuickShow::KuickShow( const char *name )
initImlib ( ) ;
resize ( 400 , 500 ) ;
m_slideTimer = new QTimer( this ) ;
connect ( m_slideTimer , SIGNAL( timeout ( ) ) , SLOT( nextSlide ( ) ) ) ;
m_slideTimer = new T QTimer( this ) ;
connect ( m_slideTimer , TQT_ SIGNAL( timeout ( ) ) , TQT_ SLOT( nextSlide ( ) ) ) ;
KConfig * kc = KGlobal : : config ( ) ;
@ -124,7 +124,7 @@ KuickShow::KuickShow( const char *name )
// files to display
// either a directory to display, an absolute path, a relative path, or a URL
KURL startDir ;
startDir . setPath ( QDir: : currentDirPath ( ) + ' / ' ) ;
startDir . setPath ( T QDir: : currentDirPath ( ) + ' / ' ) ;
int numArgs = args - > count ( ) ;
if ( numArgs > = 10 )
@ -133,7 +133,7 @@ KuickShow::KuickShow( const char *name )
if ( KMessageBox : : warningYesNo (
this ,
i18n ( " Do you really want to display this 1 image at the same time? This might be quite resource intensive and could overload your computer.<br>If you choose %1, only the first image will be shown. " ,
" Do you really want to display these %n images at the same time? This might be quite resource intensive and could overload your computer.<br>If you choose %1, only the first image will be shown. " , numArgs ) . arg( KStdGuiItem : : no ( ) . plainText ( ) ) ,
" Do you really want to display these %n images at the same time? This might be quite resource intensive and could overload your computer.<br>If you choose %1, only the first image will be shown. " , numArgs ) . tq arg( KStdGuiItem : : no ( ) . plainText ( ) ) ,
i18n ( " Display Multiple Images? " ) )
! = KMessageBox : : Yes )
{
@ -164,7 +164,7 @@ KuickShow::KuickShow( const char *name )
else if ( ! url . isLocalFile ( ) )
{
KMimeType : : Ptr mime = KMimeType : : findByURL ( url ) ;
QString name = mime - > name ( ) ;
T QString name = mime - > name ( ) ;
if ( name = = " application/octet-stream " ) // unknown -> stat()
name = KIO : : NetAccess : : mimetype ( url , this ) ;
@ -231,39 +231,39 @@ void KuickShow::initGUI( const KURL& startDir )
redirectDeleteAndTrashActions ( coll ) ;
connect ( fileWidget , SIGNAL( fileSelected ( const KFileItem * ) ) ,
this , SLOT( slotSelected ( const KFileItem * ) ) ) ;
connect ( fileWidget , TQT_ SIGNAL( fileSelected ( const KFileItem * ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( slotSelected ( const KFileItem * ) ) ) ;
connect ( fileWidget , SIGNAL( fileHighlighted ( const KFileItem * ) ) ,
this , SLOT( slotHighlighted ( const KFileItem * ) ) ) ;
connect ( fileWidget , TQT_ SIGNAL( fileHighlighted ( const KFileItem * ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( slotHighlighted ( const KFileItem * ) ) ) ;
connect ( fileWidget , SIGNAL( urlEntered ( const KURL & ) ) ,
this , SLOT( dirSelected ( const KURL & ) ) ) ;
connect ( fileWidget , TQT_ SIGNAL( urlEntered ( const KURL & ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( dirSelected ( const KURL & ) ) ) ;
fileWidget - > setAcceptDrops ( true ) ;
connect ( fileWidget , SIGNAL( dropped ( const KFileItem * , QDropEvent * , const KURL : : List & ) ) ,
this , SLOT( slotDropped ( const KFileItem * , QDropEvent * , const KURL : : List & ) ) ) ;
connect ( fileWidget , TQT_ SIGNAL( dropped ( const KFileItem * , T QDropEvent * , const KURL : : List & ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( slotDropped ( const KFileItem * , T QDropEvent * , const KURL : : List & ) ) ) ;
// setup actions
KAction * open = KStdAction : : open ( this , SLOT( slotOpenURL ( ) ) ,
KAction * open = KStdAction : : open ( TQT_TQOBJECT ( this ) , TQT_ SLOT( slotOpenURL ( ) ) ,
coll , " openURL " ) ;
KAction * print = KStdAction : : print ( this , SLOT( slotPrint ( ) ) ,
KAction * print = KStdAction : : print ( TQT_TQOBJECT ( this ) , TQT_ SLOT( slotPrint ( ) ) ,
coll , " kuick_print " ) ;
print - > setText ( i18n ( " Print Image... " ) ) ;
KAction * configure = new KAction ( i18n ( " Configure %1... " ) . arg( KGlobal : : instance ( ) - > aboutData ( ) - > programName ( ) ) , " configure " ,
KAction * configure = new KAction ( i18n ( " Configure %1... " ) . tq arg( KGlobal : : instance ( ) - > aboutData ( ) - > programName ( ) ) , " configure " ,
KShortcut ( ) ,
this , SLOT( configuration ( ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( configuration ( ) ) ,
coll , " kuick_configure " ) ;
KAction * slide = new KAction ( i18n ( " Start Slideshow " ) , " ksslide " ,
KShortcut ( Key_F2 ) ,
this , SLOT( startSlideShow ( ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( startSlideShow ( ) ) ,
coll , " kuick_slideshow " ) ;
KAction * about = new KAction ( i18n ( " About KuickShow " ) , " about " ,
KShortcut ( ) ,
this , SLOT( about ( ) ) , coll , " about " ) ;
TQT_TQOBJECT ( this ) , TQT_ SLOT( about ( ) ) , coll , " about " ) ;
oneWindowAction = new KToggleAction ( i18n ( " Open Only One Image Window " ) ,
" window_new " ,
@ -272,29 +272,29 @@ void KuickShow::initGUI( const KURL& startDir )
m_toggleBrowserAction = new KToggleAction ( i18n ( " Show File Browser " ) , KShortcut ( Key_Space ) , coll , " toggleBrowser " ) ;
m_toggleBrowserAction - > setCheckedState ( i18n ( " Hide File Browser " ) ) ;
connect ( m_toggleBrowserAction , SIGNAL( toggled ( bool ) ) ,
SLOT( toggleBrowser ( ) ) ) ;
connect ( m_toggleBrowserAction , TQT_ SIGNAL( toggled ( bool ) ) ,
TQT_ SLOT( toggleBrowser ( ) ) ) ;
KAction * showInOther = new KAction ( i18n ( " Show Image " ) , KShortcut ( ) ,
this , SLOT( slotShowInOtherWindow ( ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( slotShowInOtherWindow ( ) ) ,
coll , " kuick_showInOtherWindow " ) ;
KAction * showInSame = new KAction ( i18n ( " Show Image in Active Window " ) ,
KShortcut ( ) ,
this , SLOT( slotShowInSameWindow ( ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( slotShowInSameWindow ( ) ) ,
coll , " kuick_showInSameWindow " ) ;
KAction * showFullscreen = new KAction ( i18n ( " Show Image in Fullscreen Mode " ) ,
KShortcut ( ) , this , SLOT( slotShowFullscreen ( ) ) ,
KShortcut ( ) , TQT_TQOBJECT ( this ) , TQT_ SLOT( slotShowFullscreen ( ) ) ,
coll , " kuick_showFullscreen " ) ;
KAction * quit = KStdAction : : quit ( this , SLOT( slotQuit ( ) ) , coll , " quit " ) ;
KAction * quit = KStdAction : : quit ( TQT_TQOBJECT ( this ) , TQT_ SLOT( slotQuit ( ) ) , coll , " quit " ) ;
// remove QString::null parameter -- ellis
coll - > readShortcutSettings ( QString: : null ) ;
// remove TQString() parameter -- ellis
coll - > readShortcutSettings ( TQString( ) ) ;
m_accel = coll - > accel ( ) ;
// menubar
KMenuBar * mBar = menuBar ( ) ;
QPopupMenu * fileMenu = new QPopupMenu( mBar , " file " ) ;
T QPopupMenu * fileMenu = new T QPopupMenu( mBar , " file " ) ;
open - > plug ( fileMenu ) ;
showInOther - > plug ( fileMenu ) ;
showInSame - > plug ( fileMenu ) ;
@ -305,7 +305,7 @@ void KuickShow::initGUI( const KURL& startDir )
fileMenu - > insertSeparator ( ) ;
quit - > plug ( fileMenu ) ;
QPopupMenu * editMenu = new QPopupMenu( mBar , " edit " ) ;
T QPopupMenu * editMenu = new T QPopupMenu( mBar , " edit " ) ;
coll - > action ( " mkdir " ) - > plug ( editMenu ) ;
coll - > action ( " delete " ) - > plug ( editMenu ) ;
editMenu - > insertSeparator ( ) ;
@ -316,10 +316,10 @@ void KuickShow::initGUI( const KURL& startDir )
// from the main contextmenu
KActionMenu * sortingMenu = static_cast < KActionMenu * > ( coll - > action ( " sorting menu " ) ) ;
KActionMenu * mainActionMenu = static_cast < KActionMenu * > ( coll - > action ( " popupMenu " ) ) ;
QPopupMenu * mainPopup = mainActionMenu - > popupMenu ( ) ;
T QPopupMenu * mainPopup = mainActionMenu - > popupMenu ( ) ;
int sortingIndex = mainPopup - > indexOf ( sortingMenu - > itemId ( 0 ) ) ;
int separatorId = mainPopup - > idAt ( sortingIndex + 1 ) ;
QMenuItem * separatorItem = mainPopup - > findItem( separatorId ) ;
T QMenuItem * separatorItem = mainPopup - > tq findItem( separatorId ) ;
if ( separatorItem & & separatorItem - > isSeparator ( ) )
mainPopup - > removeItem ( separatorId ) ;
mainActionMenu - > remove ( sortingMenu ) ;
@ -330,7 +330,7 @@ void KuickShow::initGUI( const KURL& startDir )
sortingMenu - > plug ( viewActionMenu - > popupMenu ( ) , 0 ) ; // on top of the menu
QPopupMenu * settingsMenu = new QPopupMenu( mBar , " settings " ) ;
T QPopupMenu * settingsMenu = new T QPopupMenu( mBar , " settings " ) ;
configure - > plug ( settingsMenu ) ;
mBar - > insertItem ( i18n ( " &File " ) , fileMenu ) ;
@ -363,14 +363,14 @@ void KuickShow::initGUI( const KURL& startDir )
tBar - > insertSeparator ( ) ;
about - > plug ( tBar ) ;
QPopupMenu * help = helpMenu ( QString: : null , false ) ;
T QPopupMenu * help = helpMenu ( TQString( ) , false ) ;
mBar - > insertItem ( KStdGuiItem : : help ( ) . text ( ) , help ) ;
KStatusBar * sBar = statusBar ( ) ;
sBar - > insertItem ( " " , URL_ITEM , 10 ) ;
sBar - > insertItem ( " " , META_ITEM , 2 ) ;
sBar - > setItemAlignment ( URL_ITEM , QLabel: : AlignVCenter | QLabel: : AlignLeft ) ;
sBar - > setItemAlignment ( URL_ITEM , T QLabel: : AlignVCenter | T QLabel: : AlignLeft ) ;
fileWidget - > setFocus ( ) ;
@ -394,10 +394,10 @@ void KuickShow::initGUI( const KURL& startDir )
addressToolBar - > insertWidget ( ID_ADDRESSBAR , 1 , cmbPath ) ;
addressToolBar - > setItemAutoSized ( ID_ADDRESSBAR ) ;
connect ( cmbPath , SIGNAL( urlActivated ( const KURL & ) ) ,
this , SLOT( slotSetURL ( const KURL & ) ) ) ;
connect ( cmbPath , SIGNAL( returnPressed ( ) ) ,
this , SLOT( slotURLComboReturnPressed ( ) ) ) ;
connect ( cmbPath , TQT_ SIGNAL( urlActivated ( const KURL & ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( slotSetURL ( const KURL & ) ) ) ;
connect ( cmbPath , TQT_ SIGNAL( returnPressed ( ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( slotURLComboReturnPressed ( ) ) ) ;
fileWidget - > initActions ( ) ;
@ -422,14 +422,14 @@ void KuickShow::redirectDeleteAndTrashActions(KActionCollection *coll)
if ( action )
{
action - > disconnect ( fileWidget ) ;
connect ( action , SIGNAL( activated ( ) ) , this , SLOT( slotDeleteCurrentImage ( ) ) ) ;
connect ( action , TQT_ SIGNAL( activated ( ) ) , TQT_TQOBJECT ( this ) , TQT_ SLOT( slotDeleteCurrentImage ( ) ) ) ;
}
action = coll - > action ( " trash " ) ;
if ( action )
{
action - > disconnect ( fileWidget ) ;
connect ( action , SIGNAL( activated ( ) ) , this , SLOT( slotTrashCurrentImage ( ) ) ) ;
connect ( action , TQT_ SIGNAL( activated ( ) ) , TQT_TQOBJECT ( this ) , TQT_ SLOT( slotTrashCurrentImage ( ) ) ) ;
}
}
@ -478,7 +478,7 @@ void KuickShow::slotHighlighted( const KFileItem *fi )
statusBar ( ) - > changeItem ( item - > getStatusBarInfo ( ) , URL_ITEM ) ;
bool image = FileWidget : : isImage ( fi ) ;
QString meta ;
T QString meta ;
if ( image )
{
KFileMetaInfo info = item - > metaInfo ( ) ;
@ -488,7 +488,7 @@ void KuickShow::slotHighlighted( const KFileItem *fi )
KFileMetaInfoGroup group = info . group ( " Technical " ) ;
if ( group . isValid ( ) )
{
QString bpp = group . item ( " BitDepth " ) . string ( ) ;
T QString bpp = group . item ( " BitDepth " ) . string ( ) ;
if ( ! bpp . isEmpty ( ) )
meta . append ( " , " ) . append ( bpp ) ;
}
@ -537,22 +537,22 @@ bool KuickShow::showImage( const KFileItem *fi,
m_viewer - > setFullscreen ( fullscreen ) ;
s_viewers . append ( m_viewer ) ;
connect ( m_viewer , SIGNAL( destroyed ( ) ) , SLOT( viewerDeleted ( ) ) ) ;
connect ( m_viewer , SIGNAL( sigFocusWindow ( ImageWindow * ) ) ,
this , SLOT( slotSetActiveViewer ( ImageWindow * ) ) ) ;
connect ( m_viewer , SIGNAL( sigImageError ( const KuickFile * , const QString& ) ) ,
this , SLOT( messageCantLoadImage ( const KuickFile * , const QString & ) ) ) ;
connect ( m_viewer , SIGNAL( requestImage ( ImageWindow * , int ) ) ,
this , SLOT( slotAdvanceImage ( ImageWindow * , int ) ) ) ;
connect ( m_viewer , SIGNAL( pauseSlideShowSignal ( ) ) ,
this , SLOT( pauseSlideShow ( ) ) ) ;
connect ( m_viewer , SIGNAL ( deleteImage ( ImageWindow * ) ) ,
this , SLOT ( slotDeleteCurrentImage ( ImageWindow * ) ) ) ;
connect ( m_viewer , SIGNAL ( trashImage ( ImageWindow * ) ) ,
this , SLOT ( slotTrashCurrentImage ( ImageWindow * ) ) ) ;
connect ( m_viewer , TQT_ SIGNAL( destroyed ( ) ) , TQT_ SLOT( viewerDeleted ( ) ) ) ;
connect ( m_viewer , TQT_ SIGNAL( sigFocusWindow ( ImageWindow * ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( slotSetActiveViewer ( ImageWindow * ) ) ) ;
connect ( m_viewer , TQT_ SIGNAL( sigImageError ( const KuickFile * , const T QString& ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( messageCantLoadImage ( const KuickFile * , const T QString & ) ) ) ;
connect ( m_viewer , TQT_ SIGNAL( requestImage ( ImageWindow * , int ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( slotAdvanceImage ( ImageWindow * , int ) ) ) ;
connect ( m_viewer , TQT_ SIGNAL( pauseSlideShowSignal ( ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( pauseSlideShow ( ) ) ) ;
connect ( m_viewer , TQT_ SIGNAL ( deleteImage ( ImageWindow * ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT ( slotDeleteCurrentImage ( ImageWindow * ) ) ) ;
connect ( m_viewer , TQT_ SIGNAL ( trashImage ( ImageWindow * ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT ( slotTrashCurrentImage ( ImageWindow * ) ) ) ;
if ( s_viewers . count ( ) = = 1 & & moveToTopLeft ) {
// we have to move to 0x0 before showing _and_
// after showing, otherwise we get some bogus geometry()
// after showing, otherwise we get some bogus tq geometry()
m_viewer - > move ( Kuick : : workArea ( ) . topLeft ( ) ) ;
}
@ -568,7 +568,7 @@ bool KuickShow::showImage( const KFileItem *fi,
ImageWindow * safeViewer = m_viewer ;
// file->waitForDownload( this );
// QString filename;
// T QString filename;
// KIO::NetAccess::download(fi->url(), filename, this);
if ( ! safeViewer - > showNextImage ( fi - > url ( ) ) ) {
@ -631,7 +631,7 @@ void KuickShow::slotTrashCurrentImage(ImageWindow *viewer)
performTrashCurrentImage ( viewer ) ;
}
void KuickShow : : performDeleteCurrentImage ( QWidget * parent)
void KuickShow : : performDeleteCurrentImage ( T QWidget * tq parent)
{
assert ( fileWidget ! = 0L ) ;
@ -640,8 +640,8 @@ void KuickShow::performDeleteCurrentImage(QWidget *parent)
list . append ( item ) ;
if ( KMessageBox : : warningContinueCancel (
parent,
i18n ( " <qt>Do you really want to delete \n <b>'%1'</b>?</qt> " ) . arg( item - > url ( ) . pathOrURL ( ) ) ,
tq parent,
i18n ( " <qt>Do you really want to delete \n <b>'%1'</b>?</qt> " ) . tq arg( item - > url ( ) . pathOrURL ( ) ) ,
i18n ( " Delete File " ) ,
KStdGuiItem : : del ( ) ,
" Kuick_delete_current_image " )
@ -654,7 +654,7 @@ void KuickShow::performDeleteCurrentImage(QWidget *parent)
fileWidget - > del ( list , false , false ) ;
}
void KuickShow : : performTrashCurrentImage ( QWidget * parent)
void KuickShow : : performTrashCurrentImage ( T QWidget * tq parent)
{
assert ( fileWidget ! = 0L ) ;
@ -665,8 +665,8 @@ void KuickShow::performTrashCurrentImage(QWidget *parent)
list . append ( item ) ;
if ( KMessageBox : : warningContinueCancel (
parent,
i18n ( " <qt>Do you really want to trash \n <b>'%1'</b>?</qt> " ) . arg( item - > url ( ) . pathOrURL ( ) ) ,
tq parent,
i18n ( " <qt>Do you really want to trash \n <b>'%1'</b>?</qt> " ) . tq arg( item - > url ( ) . pathOrURL ( ) ) ,
i18n ( " Trash File " ) ,
KGuiItem ( i18n ( " to trash " , " &Trash " ) , " edittrash " ) ,
" Kuick_trash_current_image " )
@ -676,7 +676,7 @@ void KuickShow::performTrashCurrentImage(QWidget *parent)
}
tryShowNextImage ( ) ;
fileWidget - > trash ( list , parent, false , false ) ;
fileWidget - > trash ( list , tq parent, false , false ) ;
}
void KuickShow : : tryShowNextImage ( )
@ -698,7 +698,7 @@ void KuickShow::tryShowNextImage()
if ( ! haveBrowser ( ) )
{
// ### when simply calling toggleBrowser(), this main window is completely messed up
QTimer: : singleShot ( 0 , this , SLOT( toggleBrowser ( ) ) ) ;
T QTimer: : singleShot ( 0 , TQT_TQOBJECT ( this ) , TQT_ SLOT( toggleBrowser ( ) ) ) ;
}
m_viewer - > deleteLater ( ) ;
}
@ -805,7 +805,7 @@ void KuickShow::slotShowFullscreen()
showImage ( fileWidget - > getCurrentItem ( false ) , false , true ) ;
}
void KuickShow : : slotDropped ( const KFileItem * , QDropEvent * , const KURL : : List & urls )
void KuickShow : : slotDropped ( const KFileItem * , T QDropEvent * , const KURL : : List & urls )
{
KURL : : List : : ConstIterator it = urls . begin ( ) ;
for ( ; it ! = urls . end ( ) ; + + it )
@ -855,7 +855,7 @@ void KuickShow::slotAdvanceImage( ImageWindow *view, int steps )
}
if ( FileWidget : : isImage ( item ) ) {
// QString filename;
// T QString filename;
// KIO::NetAccess::download(item->url(), filename, this);
view - > showNextImage ( item - > url ( ) ) ;
if ( m_slideTimer - > isActive ( ) & & kdata - > slideDelay )
@ -869,7 +869,7 @@ void KuickShow::slotAdvanceImage( ImageWindow *view, int steps )
}
}
bool KuickShow : : eventFilter ( QObject * o , QEvent * e )
bool KuickShow : : eventFilter ( T QObject * o , T QEvent * e )
{
if ( m_delayedRepeatItem ) // we probably need to install an eventFilter over
{
@ -878,9 +878,9 @@ bool KuickShow::eventFilter( QObject *o, QEvent *e )
bool ret = false ;
int eventType = e - > type ( ) ;
QKeyEvent * k = 0L ;
if ( eventType = = QEvent: : KeyPress )
k = static_cast < QKeyEvent * > ( e ) ;
T QKeyEvent * k = 0L ;
if ( eventType = = T QEvent: : KeyPress )
k = TQT_TQKEYEVENT ( e ) ;
if ( k ) {
if ( KStdAccel : : quit ( ) . contains ( KKey ( k ) ) ) {
@ -903,11 +903,11 @@ bool KuickShow::eventFilter( QObject *o, QEvent *e )
// switching images, causing enter- and leaveevents for this
// ImageWindow, leading to the cursor being unhidden. So we simply
// don't pass those events to KCursor to prevent that.
if ( eventType ! = QEvent: : Leave & & eventType ! = QEvent: : Enter )
if ( eventType ! = T QEvent: : Leave & & eventType ! = T QEvent: : Enter )
KCursor : : autoHideEventFilter ( o , e ) ;
m_viewer = window ;
QString img ;
T QString img ;
KFileItem * item = 0L ; // the image to be shown
KFileItem * item_next = 0L ; // the image to be cached
@ -925,7 +925,7 @@ bool KuickShow::eventFilter( QObject *o, QEvent *e )
if ( key ! = Key_Escape & & key ! = Key_Shift & & key ! = Key_Alt )
{
KuickFile * file = m_viewer - > currentFile ( ) ;
// QFileInfo fi( m_viewer->filename() );
// T QFileInfo fi( m_viewer->filename() );
// start.setPath( fi.dirPath( true ) );
initGUI ( file - > url ( ) . upURL ( ) ) ;
@ -952,7 +952,7 @@ bool KuickShow::eventFilter( QObject *o, QEvent *e )
if ( fileWidget - > dirLister ( ) - > rootItem ( ) )
{
fileWidget - > setCurrentItem ( file - > url ( ) . fileName ( ) ) ;
QTimer: : singleShot ( 0 , this , SLOT( slotReplayEvent ( ) ) ) ;
T QTimer: : singleShot ( 0 , TQT_TQOBJECT ( this ) , TQT_ SLOT( slotReplayEvent ( ) ) ) ;
}
else // finished, but no root-item -- probably an error, kill repeat-item!
{
@ -962,8 +962,8 @@ bool KuickShow::eventFilter( QObject *o, QEvent *e )
else // not finished yet
{
fileWidget - > setInitialItem ( file - > url ( ) . fileName ( ) ) ;
connect ( fileWidget , SIGNAL( finished ( ) ) ,
SLOT( slotReplayEvent ( ) ) ) ;
connect ( fileWidget , TQT_ SIGNAL( finished ( ) ) ,
TQT_ SLOT( slotReplayEvent ( ) ) ) ;
}
return true ;
@ -1018,7 +1018,7 @@ bool KuickShow::eventFilter( QObject *o, QEvent *e )
if ( FileWidget : : isImage ( item ) ) {
// QString filename;
// T QString filename;
// KIO::NetAccess::download(item->url(), filename, this);
m_viewer - > showNextImage ( item - > url ( ) ) ;
@ -1034,17 +1034,17 @@ bool KuickShow::eventFilter( QObject *o, QEvent *e )
// doubleclick closes image window
// and shows browser when last window closed via doubleclick
else if ( eventType = = QEvent: : MouseButtonDblClick )
else if ( eventType = = T QEvent: : MouseButtonDblClick )
{
QMouseEvent * ev = static_cast < QMouseEvent * > ( e ) ;
if ( ev - > button ( ) = = LeftButton )
TQMouseEvent * ev = TQT_TQMOUSEEVENT ( e ) ;
if ( ev - > button ( ) = = Qt: : LeftButton )
{
if ( s_viewers . count ( ) = = 1 )
{
if ( ! fileWidget )
{
// KURL start;
// QFileInfo fi( window->filename() );
// T QFileInfo fi( window->filename() );
// start.setPath( fi.dirPath( true ) );
initGUI ( window - > currentFile ( ) - > url ( ) . fileName ( ) ) ;
}
@ -1072,8 +1072,8 @@ void KuickShow::configuration()
{
if ( ! m_accel ) {
KURL start ;
start . setPath ( QDir: : homeDirPath ( ) ) ;
initGUI ( KURL : : fromPathOrURL ( QDir: : homeDirPath ( ) ) ) ;
start . setPath ( T QDir: : homeDirPath ( ) ) ;
initGUI ( KURL : : fromPathOrURL ( T QDir: : homeDirPath ( ) ) ) ;
}
dialog = new KuickConfigDialog ( fileWidget - > actionCollection ( ) , 0L ,
@ -1081,12 +1081,12 @@ void KuickShow::configuration()
dialog - > resize ( 540 , 510 ) ;
dialog - > setIcon ( kapp - > miniIcon ( ) ) ;
connect ( dialog , SIGNAL( okClicked ( ) ) ,
this , SLOT( slotConfigApplied ( ) ) ) ;
connect ( dialog , SIGNAL( applyClicked ( ) ) ,
this , SLOT( slotConfigApplied ( ) ) ) ;
connect ( dialog , SIGNAL( finished ( ) ) ,
this , SLOT( slotConfigClosed ( ) ) ) ;
connect ( dialog , TQT_ SIGNAL( okClicked ( ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( slotConfigApplied ( ) ) ) ;
connect ( dialog , TQT_ SIGNAL( applyClicked ( ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( slotConfigApplied ( ) ) ) ;
connect ( dialog , TQT_ SIGNAL( finished ( ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( slotConfigClosed ( ) ) ) ;
fileWidget - > actionCollection ( ) - > action ( " kuick_configure " ) - > setEnabled ( false ) ;
dialog - > show ( ) ;
@ -1101,7 +1101,7 @@ void KuickShow::slotConfigApplied()
kdata - > save ( ) ;
ImageWindow * viewer ;
QValueListIterator< ImageWindow * > it = s_viewers . begin ( ) ;
T QValueListIterator< ImageWindow * > it = s_viewers . begin ( ) ;
while ( it ! = s_viewers . end ( ) ) {
viewer = * it ;
viewer - > updateActions ( ) ;
@ -1129,12 +1129,12 @@ void KuickShow::about()
KDialog : : centerOnScreen ( aboutWidget ) ;
# else
// Not fixed because it must be dead code now.
QDesktopWidget * desktop = QApplication: : desktop ( ) ;
T QDesktopWidget * desktop = T QApplication: : desktop ( ) ;
int screen = desktop - > screenNumber ( aboutWidget ) ;
if ( screen = = - 1 )
screen = desktop - > primaryScreen ( ) ;
QRect r = desktop - > screenGeometry ( screen ) ;
T QRect r = desktop - > screenGeometry ( screen ) ;
aboutWidget - > move ( r . center ( ) . x ( ) - aboutWidget - > width ( ) / 2 ,
r . center ( ) . y ( ) - aboutWidget - > height ( ) / 2 ) ;
# endif
@ -1146,15 +1146,15 @@ void KuickShow::about()
void KuickShow : : readProperties ( KConfig * kc )
{
assert ( fileWidget ) ; // from SM, we should always have initGUI on startup
QString dir = kc - > readPathEntry ( " CurrentDirectory " ) ;
T QString dir = kc - > readPathEntry ( " CurrentDirectory " ) ;
if ( ! dir . isEmpty ( ) ) {
fileWidget - > setURL ( KURL : : fromPathOrURL ( dir ) , true ) ;
fileWidget - > clearHistory ( ) ;
}
const KURL & listedURL = fileWidget - > url ( ) ;
QStringList images = kc - > readPathListEntry ( " Images shown " ) ;
QStringList: : Iterator it ;
T QStringList images = kc - > readPathListEntry ( " Images shown " ) ;
T QStringList: : Iterator it ;
bool hasCurrentURL = false ;
for ( it = images . begin ( ) ; it ! = images . end ( ) ; + + it ) {
@ -1179,8 +1179,8 @@ void KuickShow::saveProperties( KConfig *kc )
if ( fileWidget )
kc - > writePathEntry ( " CurrentDirectory " , fileWidget - > url ( ) . url ( ) ) ;
QStringList urls ;
QValueListIterator< ImageWindow * > it ;
T QStringList urls ;
T QValueListIterator< ImageWindow * > it ;
for ( it = s_viewers . begin ( ) ; it ! = s_viewers . end ( ) ; + + it )
{
const KURL & url = ( * it ) - > currentFile ( ) - > url ( ) ;
@ -1212,7 +1212,7 @@ void KuickShow::saveSettings()
}
void KuickShow : : messageCantLoadImage ( const KuickFile * , const QString& message )
void KuickShow : : messageCantLoadImage ( const KuickFile * , const T QString& message )
{
m_viewer - > clearFocus ( ) ;
KMessageBox : : information ( m_viewer , message , i18n ( " Error " ) , " kuick_cant_load_image " ) ;
@ -1229,7 +1229,7 @@ void KuickShow::initImlib()
initImlibParams ( idata , & par ) ;
qWarning ( " *** KuickShow: Whoops, can't initialize imlib, trying my own palettefile now. " ) ;
QString paletteFile = locate ( " data " , " kuickshow/im_palette.pal " ) ;
T QString paletteFile = locate ( " data " , " kuickshow/im_palette.pal " ) ;
// ### - does the qstrdup() cure the segfault in imlib eventually?
char * file = qstrdup ( paletteFile . local8Bit ( ) ) ;
par . palettefile = file ;
@ -1240,7 +1240,7 @@ void KuickShow::initImlib()
id = Imlib_init_with_params ( x11Display ( ) , & par ) ;
if ( ! id ) {
QString tmp = i18n ( " Unable to initialize \" Imlib \" . \n "
T QString tmp = i18n ( " Unable to initialize \" Imlib \" . \n "
" Start kuickshow from the command line "
" and look for error messages. \n "
" The program will now quit. " ) ;
@ -1281,9 +1281,9 @@ bool KuickShow::haveBrowser() const
return fileWidget & & fileWidget - > isVisible ( ) ;
}
void KuickShow : : delayedRepeatEvent ( ImageWindow * w , QKeyEvent * e )
void KuickShow : : delayedRepeatEvent ( ImageWindow * w , T QKeyEvent * e )
{
m_delayedRepeatItem = new DelayedRepeatEvent ( w , new QKeyEvent( * e ) ) ;
m_delayedRepeatItem = new DelayedRepeatEvent ( w , new T QKeyEvent( * e ) ) ;
}
void KuickShow : : abortDelayedEvent ( )
@ -1294,19 +1294,19 @@ void KuickShow::abortDelayedEvent()
void KuickShow : : slotReplayEvent ( )
{
disconnect ( fileWidget , SIGNAL( finished ( ) ) ,
this , SLOT( slotReplayEvent ( ) ) ) ;
disconnect ( fileWidget , TQT_ SIGNAL( finished ( ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( slotReplayEvent ( ) ) ) ;
DelayedRepeatEvent * e = m_delayedRepeatItem ;
m_delayedRepeatItem = 0L ; // otherwise, eventFilter aborts
eventFilter ( e- > viewer , e- > event ) ;
eventFilter ( TQT_TQOBJECT( e- > viewer ) , TQT_TQEVENT( e- > event ) ) ;
delete e ;
// ### WORKAROUND for QIconView bug in Qt <= 3.0.3 at least
// ### WORKAROUND for T QIconView bug in T Qt <= 3.0.3 at least
if ( fileWidget & & fileWidget - > view ( ) ) {
QWidget * widget = fileWidget - > view ( ) - > widget ( ) ;
if ( widget - > inherits ( " QIconView " ) | | widget - > child ( 0 , " QIconView " ) ) {
T QWidget * widget = fileWidget - > view ( ) - > widget ( ) ;
if ( widget - > inherits ( TQICONVIEW_OBJECT_NAME_STRING ) | | widget - > child ( 0 , TQICONVIEW_OBJECT_NAME_STRING ) ) {
fileWidget - > setSorting ( fileWidget - > sorting ( ) ) ;
}
}
@ -1315,12 +1315,12 @@ void KuickShow::slotReplayEvent()
void KuickShow : : replayAdvance ( DelayedRepeatEvent * event )
{
// ### WORKAROUND for QIconView bug in Qt <= 3.0.3 at least
// ### WORKAROUND for T QIconView bug in T Qt <= 3.0.3 at least
// Sigh. According to qt-bugs, they won't fix this bug ever. So you can't
// rely on sorting to be correct before the QIconView has been show()n.
// rely on sorting to be correct before the T QIconView has been show()n.
if ( fileWidget & & fileWidget - > view ( ) ) {
QWidget * widget = fileWidget - > view ( ) - > widget ( ) ;
if ( widget - > inherits ( " QIconView " ) | | widget - > child ( 0 , " QIconView " ) ) {
T QWidget * widget = fileWidget - > view ( ) - > widget ( ) ;
if ( widget - > inherits ( TQICONVIEW_OBJECT_NAME_STRING ) | | widget - > child ( 0 , TQICONVIEW_OBJECT_NAME_STRING ) ) {
fileWidget - > setSorting ( fileWidget - > sorting ( ) ) ;
}
}
@ -1337,7 +1337,7 @@ void KuickShow::delayAction(DelayedRepeatEvent *event)
m_delayedRepeatItem = event ;
KURL url = event - > viewer - > currentFile ( ) - > url ( ) ;
// QFileInfo fi( event->viewer->filename() );
// T QFileInfo fi( event->viewer->filename() );
// start.setPath( fi.dirPath( true ) );
initGUI ( url . upURL ( ) ) ;
@ -1346,13 +1346,13 @@ void KuickShow::delayAction(DelayedRepeatEvent *event)
fileWidget - > dirLister ( ) - > rootItem ( ) )
{
fileWidget - > setCurrentItem ( url . fileName ( ) ) ;
QTimer: : singleShot ( 0 , this , SLOT( doReplay ( ) ) ) ;
T QTimer: : singleShot ( 0 , TQT_TQOBJECT ( this ) , TQT_ SLOT( doReplay ( ) ) ) ;
}
else
{
fileWidget - > setInitialItem ( url . fileName ( ) ) ;
connect ( fileWidget , SIGNAL( finished ( ) ) ,
SLOT( doReplay ( ) ) ) ;
connect ( fileWidget , TQT_ SIGNAL( finished ( ) ) ,
TQT_ SLOT( doReplay ( ) ) ) ;
}
}
@ -1361,16 +1361,16 @@ void KuickShow::doReplay()
if ( ! m_delayedRepeatItem )
return ;
disconnect ( fileWidget , SIGNAL( finished ( ) ) ,
this , SLOT( doReplay ( ) ) ) ;
disconnect ( fileWidget , TQT_ SIGNAL( finished ( ) ) ,
TQT_TQOBJECT ( this ) , TQT_ SLOT( doReplay ( ) ) ) ;
switch ( m_delayedRepeatItem - > action )
{
case DelayedRepeatEvent : : DeleteCurrentFile :
performDeleteCurrentImage ( ( QWidget * ) m_delayedRepeatItem - > data ) ;
performDeleteCurrentImage ( ( T QWidget * ) m_delayedRepeatItem - > data ) ;
break ;
case DelayedRepeatEvent : : TrashCurrentFile :
performTrashCurrentImage ( ( QWidget * ) m_delayedRepeatItem - > data ) ;
performTrashCurrentImage ( ( T QWidget * ) m_delayedRepeatItem - > data ) ;
break ;
case DelayedRepeatEvent : : AdvanceViewer :
replayAdvance ( m_delayedRepeatItem ) ;
@ -1401,11 +1401,11 @@ void KuickShow::toggleBrowser()
void KuickShow : : slotOpenURL ( )
{
KFileDialog dlg ( QString: : null , kdata - > fileFilter , this , " filedialog " , true ) ;
KFileDialog dlg ( TQString( ) , kdata - > fileFilter , this , " filedialog " , true ) ;
dlg . setMode ( KFile : : Files | KFile : : Directory ) ;
dlg . setCaption ( i18n ( " Select Files or Folder to Open " ) ) ;
if ( dlg . exec ( ) = = QDialog: : Accepted )
if ( dlg . exec ( ) = = T QDialog: : Accepted )
{
KURL : : List urls = dlg . selectedURLs ( ) ;
KURL : : List : : ConstIterator it = urls . begin ( ) ;
@ -1422,9 +1422,9 @@ void KuickShow::slotOpenURL()
void KuickShow : : deleteAllViewers ( )
{
QValueListIterator< ImageWindow * > it = s_viewers . begin ( ) ;
T QValueListIterator< ImageWindow * > it = s_viewers . begin ( ) ;
for ( ; it ! = s_viewers . end ( ) ; + + it ) {
( * it ) - > disconnect ( SIGNAL( destroyed ( ) ) , this , SLOT( viewerDeleted ( ) ) ) ;
( * it ) - > disconnect ( TQT_ SIGNAL( destroyed ( ) ) , TQT_TQOBJECT ( this ) , TQT_ SLOT( viewerDeleted ( ) ) ) ;
( * it ) - > close ( true ) ;
}