You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
505 lines
15 KiB
505 lines
15 KiB
15 years ago
|
/* This file is part of the KDE project
|
||
|
Copyright (C) 2000 Simon Hausmann <hausmann@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 "konq_actions.h"
|
||
|
|
||
|
#include <assert.h>
|
||
|
|
||
12 years ago
|
#include <tdetoolbarbutton.h>
|
||
15 years ago
|
#include <kanimwidget.h>
|
||
|
#include <kdebug.h>
|
||
|
#include <kstringhandler.h>
|
||
|
|
||
|
#include <konq_pixmapprovider.h>
|
||
|
#include <kiconloader.h>
|
||
12 years ago
|
#include <tdepopupmenu.h>
|
||
12 years ago
|
#include <tdeapplication.h>
|
||
15 years ago
|
|
||
|
#include "konq_view.h"
|
||
|
#include "konq_settingsxt.h"
|
||
|
|
||
15 years ago
|
template class TQPtrList<KonqHistoryEntry>;
|
||
15 years ago
|
|
||
|
/////////////////
|
||
|
|
||
|
//static - used by KonqHistoryAction and KonqBidiHistoryAction
|
||
15 years ago
|
void KonqBidiHistoryAction::fillHistoryPopup( const TQPtrList<HistoryEntry> &history,
|
||
|
TQPopupMenu * popup,
|
||
15 years ago
|
bool onlyBack,
|
||
|
bool onlyForward,
|
||
|
bool checkCurrentItem,
|
||
|
uint startPos )
|
||
|
{
|
||
|
assert ( popup ); // kill me if this 0... :/
|
||
|
|
||
13 years ago
|
//kdDebug(1202) << "fillHistoryPopup position: " << history.at() << endl;
|
||
15 years ago
|
HistoryEntry * current = history.current();
|
||
15 years ago
|
TQPtrListIterator<HistoryEntry> it( history );
|
||
15 years ago
|
if (onlyBack || onlyForward)
|
||
|
{
|
||
13 years ago
|
it += history.at(); // Jump to current item
|
||
15 years ago
|
if ( !onlyForward ) --it; else ++it; // And move off it
|
||
|
} else if ( startPos )
|
||
|
it += startPos; // Jump to specified start pos
|
||
|
|
||
|
uint i = 0;
|
||
|
while ( it.current() )
|
||
|
{
|
||
15 years ago
|
TQString text = it.current()->title;
|
||
15 years ago
|
text = KStringHandler::cEmSqueeze(text, popup->fontMetrics(), 30); //CT: squeeze
|
||
13 years ago
|
text.replace( "&", "&&" );
|
||
15 years ago
|
if ( checkCurrentItem && it.current() == current )
|
||
|
{
|
||
|
int id = popup->insertItem( text ); // no pixmap if checked
|
||
|
popup->setItemChecked( id, true );
|
||
|
} else
|
||
|
popup->insertItem( KonqPixmapProvider::self()->pixmapFor(
|
||
|
it.current()->url.url() ), text );
|
||
|
if ( ++i > 10 )
|
||
|
break;
|
||
|
if ( !onlyForward ) --it; else ++it;
|
||
|
}
|
||
13 years ago
|
//kdDebug(1202) << "After fillHistoryPopup position: " << history.at() << endl;
|
||
15 years ago
|
}
|
||
|
|
||
|
///////////////////////////////
|
||
|
|
||
15 years ago
|
KonqBidiHistoryAction::KonqBidiHistoryAction ( const TQString & text, TQObject* parent, const char* name )
|
||
12 years ago
|
: TDEAction( text, 0, parent, name )
|
||
15 years ago
|
{
|
||
|
setShortcutConfigurable(false);
|
||
|
m_firstIndex = 0;
|
||
|
m_goMenu = 0L;
|
||
|
}
|
||
|
|
||
15 years ago
|
int KonqBidiHistoryAction::plug( TQWidget *widget, int index )
|
||
15 years ago
|
{
|
||
12 years ago
|
if (kapp && !kapp->authorizeTDEAction(name()))
|
||
15 years ago
|
return -1;
|
||
|
|
||
|
// Go menu
|
||
14 years ago
|
if ( widget->inherits(TQPOPUPMENU_OBJECT_NAME_STRING) )
|
||
15 years ago
|
{
|
||
15 years ago
|
m_goMenu = (TQPopupMenu*)widget;
|
||
15 years ago
|
// Forward signal (to main view)
|
||
15 years ago
|
connect( m_goMenu, TQT_SIGNAL( aboutToShow() ),
|
||
|
this, TQT_SIGNAL( menuAboutToShow() ) );
|
||
|
connect( m_goMenu, TQT_SIGNAL( activated( int ) ),
|
||
|
this, TQT_SLOT( slotActivated( int ) ) );
|
||
15 years ago
|
//kdDebug(1202) << "m_goMenu->count()=" << m_goMenu->count() << endl;
|
||
14 years ago
|
// Store how many items the menu already contains.
|
||
15 years ago
|
// This means, the KonqBidiHistoryAction has to be plugged LAST in a menu !
|
||
|
m_firstIndex = m_goMenu->count();
|
||
|
return m_goMenu->count(); // hmmm, what should this be ?
|
||
|
}
|
||
12 years ago
|
return TDEAction::plug( widget, index );
|
||
15 years ago
|
}
|
||
|
|
||
15 years ago
|
void KonqBidiHistoryAction::fillGoMenu( const TQPtrList<HistoryEntry> & history )
|
||
15 years ago
|
{
|
||
|
if (history.isEmpty())
|
||
|
return; // nothing to do
|
||
|
|
||
13 years ago
|
//kdDebug(1202) << "fillGoMenu position: " << history.at() << endl;
|
||
15 years ago
|
if ( m_firstIndex == 0 ) // should never happen since done in plug
|
||
|
m_firstIndex = m_goMenu->count();
|
||
|
else
|
||
|
{ // Clean up old history (from the end, to avoid shifts)
|
||
|
for ( uint i = m_goMenu->count()-1 ; i >= m_firstIndex; i-- )
|
||
|
m_goMenu->removeItemAt( i );
|
||
|
}
|
||
|
// TODO perhaps smarter algorithm (rename existing items, create new ones only if not enough) ?
|
||
|
|
||
|
// Ok, we want to show 10 items in all, among which the current url...
|
||
|
|
||
|
if ( history.count() <= 9 )
|
||
|
{
|
||
|
// First case: limited history in both directions -> show it all
|
||
|
m_startPos = history.count() - 1; // Start right from the end
|
||
|
} else
|
||
|
// Second case: big history, in one or both directions
|
||
|
{
|
||
|
// Assume both directions first (in this case we place the current URL in the middle)
|
||
13 years ago
|
m_startPos = history.at() + 4;
|
||
15 years ago
|
|
||
|
// Forward not big enough ?
|
||
13 years ago
|
if ( history.at() > (int)history.count() - 4 )
|
||
15 years ago
|
m_startPos = history.count() - 1;
|
||
|
}
|
||
|
Q_ASSERT( m_startPos >= 0 && (uint)m_startPos < history.count() );
|
||
|
if ( m_startPos < 0 || (uint)m_startPos >= history.count() )
|
||
|
{
|
||
|
kdWarning() << "m_startPos=" << m_startPos << " history.count()=" << history.count() << endl;
|
||
|
return;
|
||
|
}
|
||
13 years ago
|
m_currentPos = history.at(); // for slotActivated
|
||
15 years ago
|
KonqBidiHistoryAction::fillHistoryPopup( history, m_goMenu, false, false, true, m_startPos );
|
||
|
}
|
||
|
|
||
|
void KonqBidiHistoryAction::slotActivated( int id )
|
||
|
{
|
||
|
// 1 for first item in the list, etc.
|
||
|
int index = m_goMenu->indexOf(id) - m_firstIndex + 1;
|
||
|
if ( index > 0 )
|
||
|
{
|
||
|
kdDebug(1202) << "Item clicked has index " << index << endl;
|
||
|
// -1 for one step back, 0 for don't move, +1 for one step forward, etc.
|
||
|
int steps = ( m_startPos+1 ) - index - m_currentPos; // make a drawing to understand this :-)
|
||
|
kdDebug(1202) << "Emit activated with steps = " << steps << endl;
|
||
|
emit activated( steps );
|
||
|
}
|
||
|
}
|
||
|
|
||
|
///////////////////////////////
|
||
|
|
||
15 years ago
|
KonqLogoAction::KonqLogoAction( const TQString& text, int accel, TQObject* parent, const char* name )
|
||
12 years ago
|
: TDEAction( text, accel, parent, name )
|
||
15 years ago
|
{
|
||
|
}
|
||
|
|
||
15 years ago
|
KonqLogoAction::KonqLogoAction( const TQString& text, int accel,
|
||
|
TQObject* receiver, const char* slot, TQObject* parent, const char* name )
|
||
12 years ago
|
: TDEAction( text, accel, receiver, slot, parent, name )
|
||
15 years ago
|
{
|
||
|
}
|
||
|
|
||
15 years ago
|
KonqLogoAction::KonqLogoAction( const TQString& text, const TQIconSet& pix, int accel, TQObject* parent, const char* name )
|
||
12 years ago
|
: TDEAction( text, pix, accel, parent, name )
|
||
15 years ago
|
{
|
||
|
}
|
||
|
|
||
15 years ago
|
KonqLogoAction::KonqLogoAction( const TQString& text, const TQIconSet& pix,int accel, TQObject* receiver, const char* slot, TQObject* parent, const char* name )
|
||
12 years ago
|
: TDEAction( text, pix, accel, receiver, slot, parent, name )
|
||
15 years ago
|
{
|
||
|
}
|
||
|
|
||
15 years ago
|
KonqLogoAction::KonqLogoAction( const TQStringList& icons, TQObject* receiver,
|
||
|
const char* slot, TQObject* parent,
|
||
15 years ago
|
const char* name )
|
||
12 years ago
|
: TDEAction( 0L, 0, receiver, slot, parent, name ) // text missing !
|
||
15 years ago
|
{
|
||
|
iconList = icons;
|
||
|
}
|
||
|
|
||
|
void KonqLogoAction::start()
|
||
|
{
|
||
|
int len = containerCount();
|
||
|
for ( int i = 0; i < len; i++ )
|
||
|
{
|
||
15 years ago
|
TQWidget *w = container( i );
|
||
15 years ago
|
|
||
12 years ago
|
if ( w->inherits( "TDEToolBar" ) )
|
||
15 years ago
|
{
|
||
12 years ago
|
KAnimWidget *anim = ((TDEToolBar *)w)->animatedWidget( menuId( i ) );
|
||
15 years ago
|
anim->start();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void KonqLogoAction::stop()
|
||
|
{
|
||
|
int len = containerCount();
|
||
|
for ( int i = 0; i < len; i++ )
|
||
|
{
|
||
15 years ago
|
TQWidget *w = container( i );
|
||
15 years ago
|
|
||
12 years ago
|
if ( w->inherits( "TDEToolBar" ) )
|
||
15 years ago
|
{
|
||
12 years ago
|
KAnimWidget *anim = ((TDEToolBar *)w)->animatedWidget( menuId( i ) );
|
||
15 years ago
|
anim->stop();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void KonqLogoAction::updateIcon(int id)
|
||
|
{
|
||
15 years ago
|
TQWidget *w = container( id );
|
||
15 years ago
|
|
||
12 years ago
|
if ( w->inherits( "TDEToolBar" ) )
|
||
15 years ago
|
{
|
||
12 years ago
|
KAnimWidget *anim = ((TDEToolBar *)w)->animatedWidget( menuId( id ) );
|
||
15 years ago
|
anim->setIcons(icon());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
15 years ago
|
int KonqLogoAction::plug( TQWidget *widget, int index )
|
||
15 years ago
|
{
|
||
12 years ago
|
if (kapp && !kapp->authorizeTDEAction(name()))
|
||
15 years ago
|
return -1;
|
||
|
|
||
|
/*
|
||
12 years ago
|
if ( widget->inherits( "TDEMainWindow" ) )
|
||
15 years ago
|
{
|
||
12 years ago
|
((TDEMainWindow*)widget)->setIndicatorWidget(m_logoLabel);
|
||
15 years ago
|
|
||
|
addContainer( widget, -1 );
|
||
|
|
||
|
return containerCount() - 1;
|
||
|
}
|
||
|
*/
|
||
12 years ago
|
if ( widget->inherits( "TDEToolBar" ) )
|
||
15 years ago
|
{
|
||
12 years ago
|
TDEToolBar *bar = (TDEToolBar *)widget;
|
||
15 years ago
|
|
||
|
int id_ = getToolButtonID();
|
||
|
|
||
11 years ago
|
bar->insertAnimatedWidget( id_, this, TQT_SIGNAL(activated()), TQString("trinity"), index );
|
||
15 years ago
|
bar->alignItemRight( id_ );
|
||
|
|
||
|
addContainer( bar, id_ );
|
||
|
|
||
15 years ago
|
connect( bar, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( slotDestroyed() ) );
|
||
15 years ago
|
|
||
|
return containerCount() - 1;
|
||
|
}
|
||
|
|
||
12 years ago
|
int containerId = TDEAction::plug( widget, index );
|
||
15 years ago
|
|
||
|
return containerId;
|
||
|
}
|
||
|
|
||
|
///////////
|
||
|
|
||
15 years ago
|
KonqViewModeAction::KonqViewModeAction( const TQString &text, const TQString &icon,
|
||
|
TQObject *parent, const char *name )
|
||
12 years ago
|
: TDERadioAction( text, icon, 0, parent, name )
|
||
15 years ago
|
{
|
||
15 years ago
|
m_menu = new TQPopupMenu;
|
||
15 years ago
|
|
||
15 years ago
|
connect( m_menu, TQT_SIGNAL( aboutToShow() ),
|
||
|
this, TQT_SLOT( slotPopupAboutToShow() ) );
|
||
|
connect( m_menu, TQT_SIGNAL( activated( int ) ),
|
||
|
this, TQT_SLOT( slotPopupActivated() ) );
|
||
|
connect( m_menu, TQT_SIGNAL( aboutToHide() ),
|
||
|
this, TQT_SLOT( slotPopupAboutToHide() ) );
|
||
15 years ago
|
}
|
||
|
|
||
|
KonqViewModeAction::~KonqViewModeAction()
|
||
|
{
|
||
|
delete m_menu;
|
||
|
}
|
||
|
|
||
15 years ago
|
int KonqViewModeAction::plug( TQWidget *widget, int index )
|
||
15 years ago
|
{
|
||
12 years ago
|
int res = TDERadioAction::plug( widget, index );
|
||
15 years ago
|
|
||
12 years ago
|
if ( widget->inherits( "TDEToolBar" ) && (res != -1) )
|
||
15 years ago
|
{
|
||
12 years ago
|
TDEToolBar *toolBar = static_cast<TDEToolBar *>( widget );
|
||
15 years ago
|
|
||
12 years ago
|
TDEToolBarButton *button = toolBar->getButton( itemId( res ) );
|
||
15 years ago
|
|
||
|
if ( m_menu->count() > 1 )
|
||
|
button->setDelayedPopup( m_menu, false );
|
||
|
}
|
||
|
|
||
|
return res;
|
||
|
}
|
||
|
|
||
|
void KonqViewModeAction::slotPopupAboutToShow()
|
||
|
{
|
||
|
m_popupActivated = false;
|
||
|
}
|
||
|
|
||
|
void KonqViewModeAction::slotPopupActivated()
|
||
|
{
|
||
|
m_popupActivated = true;
|
||
|
}
|
||
|
|
||
|
void KonqViewModeAction::slotPopupAboutToHide()
|
||
|
{
|
||
|
if ( !m_popupActivated )
|
||
|
{
|
||
|
int i = 0;
|
||
|
for (; i < containerCount(); ++i )
|
||
|
{
|
||
15 years ago
|
TQWidget *widget = container( i );
|
||
12 years ago
|
if ( !widget->inherits( "TDEToolBar" ) )
|
||
15 years ago
|
continue;
|
||
|
|
||
12 years ago
|
TDEToolBar *tb = static_cast<TDEToolBar *>( widget );
|
||
15 years ago
|
|
||
12 years ago
|
TDEToolBarButton *button = tb->getButton( itemId( i ) );
|
||
15 years ago
|
|
||
|
button->setDown( isChecked() );
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
MostOftenList * KonqMostOftenURLSAction::s_mostEntries = 0L;
|
||
|
uint KonqMostOftenURLSAction::s_maxEntries = 0;
|
||
|
|
||
15 years ago
|
KonqMostOftenURLSAction::KonqMostOftenURLSAction( const TQString& text,
|
||
|
TQObject *parent,
|
||
15 years ago
|
const char *name )
|
||
12 years ago
|
: TDEActionMenu( text, "goto", parent, name )
|
||
15 years ago
|
{
|
||
|
setDelayed( false );
|
||
|
|
||
15 years ago
|
connect( popupMenu(), TQT_SIGNAL( aboutToShow() ), TQT_SLOT( slotFillMenu() ));
|
||
|
//connect( popupMenu(), TQT_SIGNAL( aboutToHide() ), TQT_SLOT( slotClearMenu() ));
|
||
|
connect( popupMenu(), TQT_SIGNAL( activated( int ) ),
|
||
|
TQT_SLOT( slotActivated(int) ));
|
||
15 years ago
|
// Need to do all this upfront for a correct initial state
|
||
|
init();
|
||
|
}
|
||
|
|
||
|
KonqMostOftenURLSAction::~KonqMostOftenURLSAction()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
void KonqMostOftenURLSAction::init()
|
||
|
{
|
||
|
s_maxEntries = KonqSettings::numberofmostvisitedURLs();
|
||
|
|
||
|
KonqHistoryManager *mgr = KonqHistoryManager::kself();
|
||
|
setEnabled( !mgr->entries().isEmpty() && s_maxEntries > 0 );
|
||
|
}
|
||
|
|
||
|
void KonqMostOftenURLSAction::parseHistory() // only ever called once
|
||
|
{
|
||
|
KonqHistoryManager *mgr = KonqHistoryManager::kself();
|
||
|
KonqHistoryIterator it( mgr->entries() );
|
||
|
|
||
15 years ago
|
connect( mgr, TQT_SIGNAL( entryAdded( const KonqHistoryEntry * )),
|
||
|
TQT_SLOT( slotEntryAdded( const KonqHistoryEntry * )));
|
||
|
connect( mgr, TQT_SIGNAL( entryRemoved( const KonqHistoryEntry * )),
|
||
|
TQT_SLOT( slotEntryRemoved( const KonqHistoryEntry * )));
|
||
|
connect( mgr, TQT_SIGNAL( cleared() ), TQT_SLOT( slotHistoryCleared() ));
|
||
15 years ago
|
|
||
|
s_mostEntries = new MostOftenList; // exit() will clean this up for now
|
||
|
for ( uint i = 0; it.current() && i < s_maxEntries; i++ ) {
|
||
|
s_mostEntries->append( it.current() );
|
||
|
++it;
|
||
|
}
|
||
|
s_mostEntries->sort();
|
||
|
|
||
|
while ( it.current() ) {
|
||
|
KonqHistoryEntry *leastOften = s_mostEntries->first();
|
||
|
KonqHistoryEntry *entry = it.current();
|
||
|
if ( leastOften->numberOfTimesVisited < entry->numberOfTimesVisited ) {
|
||
|
s_mostEntries->removeFirst();
|
||
|
s_mostEntries->inSort( entry );
|
||
|
}
|
||
|
|
||
|
++it;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void KonqMostOftenURLSAction::slotEntryAdded( const KonqHistoryEntry *entry )
|
||
|
{
|
||
|
// if it's already present, remove it, and inSort it
|
||
|
s_mostEntries->removeRef( entry );
|
||
|
|
||
|
if ( s_mostEntries->count() >= s_maxEntries ) {
|
||
|
KonqHistoryEntry *leastOften = s_mostEntries->first();
|
||
|
if ( leastOften->numberOfTimesVisited < entry->numberOfTimesVisited ) {
|
||
|
s_mostEntries->removeFirst();
|
||
|
s_mostEntries->inSort( entry );
|
||
|
}
|
||
|
}
|
||
|
|
||
|
else
|
||
|
s_mostEntries->inSort( entry );
|
||
|
setEnabled( !s_mostEntries->isEmpty() );
|
||
|
}
|
||
|
|
||
|
void KonqMostOftenURLSAction::slotEntryRemoved( const KonqHistoryEntry *entry )
|
||
|
{
|
||
|
s_mostEntries->removeRef( entry );
|
||
|
setEnabled( !s_mostEntries->isEmpty() );
|
||
|
}
|
||
|
|
||
|
void KonqMostOftenURLSAction::slotHistoryCleared()
|
||
|
{
|
||
|
s_mostEntries->clear();
|
||
|
setEnabled( false );
|
||
|
}
|
||
|
|
||
|
void KonqMostOftenURLSAction::slotFillMenu()
|
||
|
{
|
||
|
if ( !s_mostEntries ) // first time
|
||
|
parseHistory();
|
||
|
|
||
|
popupMenu()->clear();
|
||
|
m_popupList.clear();
|
||
|
|
||
|
int id = s_mostEntries->count() -1;
|
||
13 years ago
|
KonqHistoryEntry *entry = s_mostEntries->at( id );
|
||
15 years ago
|
while ( entry ) {
|
||
|
// we take either title, typedURL or URL (in this order)
|
||
15 years ago
|
TQString text = entry->title.isEmpty() ? (entry->typedURL.isEmpty() ?
|
||
15 years ago
|
entry->url.prettyURL() :
|
||
|
entry->typedURL) :
|
||
|
entry->title;
|
||
|
|
||
|
popupMenu()->insertItem(
|
||
|
KonqPixmapProvider::self()->pixmapFor( entry->url.url() ),
|
||
|
text, id );
|
||
|
// Keep a copy of the URLs being shown in the menu
|
||
|
// This prevents crashes when another process tells us to remove an entry.
|
||
|
m_popupList.prepend( entry->url );
|
||
|
|
||
13 years ago
|
entry = (id > 0) ? s_mostEntries->at( --id ) : 0L;
|
||
15 years ago
|
}
|
||
|
setEnabled( !s_mostEntries->isEmpty() );
|
||
|
Q_ASSERT( s_mostEntries->count() == m_popupList.count() );
|
||
|
}
|
||
|
|
||
|
#if 0
|
||
|
void KonqMostOftenURLSAction::slotClearMenu()
|
||
|
{
|
||
|
// Warning this is called _before_ slotActivated, when activating a menu item.
|
||
|
// So e.g. don't clear m_popupList here.
|
||
|
}
|
||
|
#endif
|
||
|
|
||
|
void KonqMostOftenURLSAction::slotActivated( int id )
|
||
|
{
|
||
|
Q_ASSERT( !m_popupList.isEmpty() ); // can not happen
|
||
|
Q_ASSERT( id < (int)m_popupList.count() );
|
||
|
|
||
|
KURL url = m_popupList[ id ];
|
||
|
if ( url.isValid() )
|
||
|
emit activated( url );
|
||
|
else
|
||
|
kdWarning() << "Invalid url: " << url.prettyURL() << endl;
|
||
|
m_popupList.clear();
|
||
|
}
|
||
|
|
||
|
// sort by numberOfTimesVisited (least often goes first)
|
||
15 years ago
|
int MostOftenList::compareItems( TQPtrCollection::Item item1,
|
||
|
TQPtrCollection::Item item2)
|
||
15 years ago
|
{
|
||
|
KonqHistoryEntry *entry1 = static_cast<KonqHistoryEntry *>( item1 );
|
||
|
KonqHistoryEntry *entry2 = static_cast<KonqHistoryEntry *>( item2 );
|
||
|
|
||
|
if ( entry1->numberOfTimesVisited > entry2->numberOfTimesVisited )
|
||
|
return 1;
|
||
|
else if ( entry1->numberOfTimesVisited < entry2->numberOfTimesVisited )
|
||
|
return -1;
|
||
|
else
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
#include "konq_actions.moc"
|