Rename KComp to avoid conflicts with KDE4

pull/2/head
Timothy Pearson 11 years ago
parent e0602f96ec
commit 563c545850

@ -243,7 +243,7 @@ void Minicli::loadConfig()
int mode = KDesktopSettings::completionMode(); int mode = KDesktopSettings::completionMode();
m_dlg->cbCommand->setCompletionMode( (TDEGlobalSettings::Completion) mode ); m_dlg->cbCommand->setCompletionMode( (TDEGlobalSettings::Completion) mode );
KCompletionBox* box = m_dlg->cbCommand->completionBox(); TDECompletionBox* box = m_dlg->cbCommand->completionBox();
if (box) if (box)
box->setActivateOnSelect( false ); box->setActivateOnSelect( false );
@ -263,8 +263,8 @@ void Minicli::loadConfig()
users << TQString::fromLocal8Bit(pw->pw_name); users << TQString::fromLocal8Bit(pw->pw_name);
endpwent(); endpwent();
KCompletion *completion = new KCompletion; TDECompletion *completion = new TDECompletion;
completion->setOrder(KCompletion::Sorted); completion->setOrder(TDECompletion::Sorted);
completion->insertItems (users); completion->insertItems (users);
m_dlg->leUsername->setCompletionObject(completion, true); m_dlg->leUsername->setCompletionObject(completion, true);

@ -127,7 +127,7 @@ void PanelExeDialog::updateIcon()
void PanelExeDialog::fillCompletion() void PanelExeDialog::fillCompletion()
{ {
KCompletion *comp = ui->m_exec->completionObject(); TDECompletion *comp = ui->m_exec->completionObject();
TQStringList exePaths = TDEStandardDirs::systemPaths(); TQStringList exePaths = TDEStandardDirs::systemPaths();
for (TQStringList::ConstIterator it = exePaths.begin(); it != exePaths.end(); it++) for (TQStringList::ConstIterator it = exePaths.begin(); it != exePaths.end(); it++)

@ -1227,7 +1227,7 @@ void KMenu::initialize()
else else
m_kcommand->completionObject()->setItems( compList ); m_kcommand->completionObject()->setItems( compList );
KCompletionBox* box = m_kcommand->completionBox(); TDECompletionBox* box = m_kcommand->completionBox();
if (box) if (box)
box->setActivateOnSelect( false ); box->setActivateOnSelect( false );

@ -270,7 +270,7 @@
Sat Nov 25 17:38:27 2000 Carsten Pfeiffer <pfeiffer@kde.org> Sat Nov 25 17:38:27 2000 Carsten Pfeiffer <pfeiffer@kde.org>
* konq_mainwindow.cc: Completion handling overhauled. We have * konq_mainwindow.cc: Completion handling overhauled. We have
one KonqHistoryManager, which holds a KCompletion object and syncs one KonqHistoryManager, which holds a TDECompletion object and syncs
the history with the completion. the history with the completion.
* konq_view.cc: * konq_view.cc:

@ -83,7 +83,7 @@ public:
void setCompletedItems( const TQStringList& items ); void setCompletedItems( const TQStringList& items );
}; };
class KonqComboCompletionBox : public KCompletionBox class KonqComboCompletionBox : public TDECompletionBox
{ {
public: public:
KonqComboCompletionBox( TQWidget *parent, const char *name = 0 ); KonqComboCompletionBox( TQWidget *parent, const char *name = 0 );
@ -108,7 +108,7 @@ KonqCombo::KonqCombo( TQWidget *parent, const char *name )
// We should also connect the completionBox' highlighted signal to // We should also connect the completionBox' highlighted signal to
// our setEditText() slot, because we're handling the signals ourselves. // our setEditText() slot, because we're handling the signals ourselves.
// But we're lazy and let KCompletionBox do this and simply switch off // But we're lazy and let TDECompletionBox do this and simply switch off
// handling of signals later. // handling of signals later.
setHandleSignals( true ); setHandleSignals( true );
@ -139,7 +139,7 @@ KonqCombo::~KonqCombo()
{ {
} }
void KonqCombo::init( KCompletion *completion ) void KonqCombo::init( TDECompletion *completion )
{ {
setCompletionObject( completion, false ); //KonqMainWindow handles signals setCompletionObject( completion, false ); //KonqMainWindow handles signals
setAutoDeleteCompletionObject( false ); setAutoDeleteCompletionObject( false );
@ -838,7 +838,7 @@ void KonqComboLineEdit::setCompletedItems( const TQStringList& items )
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
KonqComboCompletionBox::KonqComboCompletionBox( TQWidget *parent, const char *name ) KonqComboCompletionBox::KonqComboCompletionBox( TQWidget *parent, const char *name )
:KCompletionBox( parent, name ) {} :TDECompletionBox( parent, name ) {}
void KonqComboCompletionBox::setItems( const TQStringList& items ) void KonqComboCompletionBox::setItems( const TQStringList& items )
{ {
@ -889,9 +889,9 @@ void KonqComboCompletionBox::setItems( const TQStringList& items )
blockSignals( block ); blockSignals( block );
// Trigger d->down_workaround = true within KCompletionBox // Trigger d->down_workaround = true within TDECompletionBox
TQStringList dummy; TQStringList dummy;
KCompletionBox::insertItems( dummy, 1 ); TDECompletionBox::insertItems( dummy, 1 );
} }
void KonqComboCompletionBox::insertStringList( const TQStringList & list, int index ) void KonqComboCompletionBox::insertStringList( const TQStringList & list, int index )

@ -25,7 +25,7 @@
#include <kcombobox.h> #include <kcombobox.h>
#include <konq_historymgr.h> #include <konq_historymgr.h>
class KCompletion; class TDECompletion;
class TDEConfig; class TDEConfig;
// we use KHistoryCombo _only_ for the up/down keyboard handling, otherwise // we use KHistoryCombo _only_ for the up/down keyboard handling, otherwise
@ -39,7 +39,7 @@ public:
~KonqCombo(); ~KonqCombo();
// initializes with the completion object and calls loadItems() // initializes with the completion object and calls loadItems()
void init( KCompletion * ); void init( TDECompletion * );
// determines internally if it's temporary or final // determines internally if it's temporary or final
void setURL( const TQString& url ); void setURL( const TQString& url );

@ -123,7 +123,7 @@ template class TQPtrList<TDEToggleAction>;
TQPtrList<KonqMainWindow> *KonqMainWindow::s_lstViews = 0; TQPtrList<KonqMainWindow> *KonqMainWindow::s_lstViews = 0;
TDEConfig * KonqMainWindow::s_comboConfig = 0; TDEConfig * KonqMainWindow::s_comboConfig = 0;
KCompletion * KonqMainWindow::s_pCompletion = 0; TDECompletion * KonqMainWindow::s_pCompletion = 0;
TQFile * KonqMainWindow::s_crashlog_file = 0; TQFile * KonqMainWindow::s_crashlog_file = 0;
bool KonqMainWindow::s_preloaded = false; bool KonqMainWindow::s_preloaded = false;
KonqMainWindow* KonqMainWindow::s_preloadedWindow = 0; KonqMainWindow* KonqMainWindow::s_preloadedWindow = 0;
@ -3287,8 +3287,8 @@ void KonqMainWindow::initCombo()
TQT_SLOT( slotMakeCompletion( const TQString& ))); TQT_SLOT( slotMakeCompletion( const TQString& )));
connect( m_combo, TQT_SIGNAL( substringCompletion( const TQString& )), connect( m_combo, TQT_SIGNAL( substringCompletion( const TQString& )),
TQT_SLOT( slotSubstringcompletion( const TQString& ))); TQT_SLOT( slotSubstringcompletion( const TQString& )));
connect( m_combo, TQT_SIGNAL( textRotation( KCompletionBase::KeyBindingType) ), connect( m_combo, TQT_SIGNAL( textRotation( TDECompletionBase::KeyBindingType) ),
TQT_SLOT( slotRotation( KCompletionBase::KeyBindingType ))); TQT_SLOT( slotRotation( TDECompletionBase::KeyBindingType )));
connect( m_combo, TQT_SIGNAL( cleared() ), connect( m_combo, TQT_SIGNAL( cleared() ),
TQT_SLOT ( slotClearHistory() ) ); TQT_SLOT ( slotClearHistory() ) );
connect( m_pURLCompletion, TQT_SIGNAL( match(const TQString&) ), connect( m_pURLCompletion, TQT_SIGNAL( match(const TQString&) ),
@ -3382,17 +3382,17 @@ void KonqMainWindow::slotSubstringcompletion( const TQString& text )
m_combo->setCompletedItems( items ); m_combo->setCompletedItems( items );
} }
void KonqMainWindow::slotRotation( KCompletionBase::KeyBindingType type ) void KonqMainWindow::slotRotation( TDECompletionBase::KeyBindingType type )
{ {
// Tell slotMatch() to do nothing // Tell slotMatch() to do nothing
m_urlCompletionStarted = false; m_urlCompletionStarted = false;
bool prev = (type == KCompletionBase::PrevCompletionMatch); bool prev = (type == TDECompletionBase::PrevCompletionMatch);
if ( prev || type == KCompletionBase::NextCompletionMatch ) { if ( prev || type == TDECompletionBase::NextCompletionMatch ) {
TQString completion = prev ? m_pURLCompletion->previousMatch() : TQString completion = prev ? m_pURLCompletion->previousMatch() :
m_pURLCompletion->nextMatch(); m_pURLCompletion->nextMatch();
if( completion.isNull() ) { // try the history KCompletion object if( completion.isNull() ) { // try the history TDECompletion object
completion = prev ? s_pCompletion->previousMatch() : completion = prev ? s_pCompletion->previousMatch() :
s_pCompletion->nextMatch(); s_pCompletion->nextMatch();
} }
@ -5550,10 +5550,10 @@ static TQString hp_tryPrepend( const TQString& s )
} }
static void hp_removeDupe( KCompletionMatches& l, const TQString& dupe, static void hp_removeDupe( TDECompletionMatches& l, const TQString& dupe,
KCompletionMatches::Iterator it_orig ) TDECompletionMatches::Iterator it_orig )
{ {
for( KCompletionMatches::Iterator it = l.begin(); for( TDECompletionMatches::Iterator it = l.begin();
it != l.end(); it != l.end();
) { ) {
if( it == it_orig ) { if( it == it_orig ) {
@ -5572,14 +5572,14 @@ static void hp_removeDupe( KCompletionMatches& l, const TQString& dupe,
// remove duplicates like 'http://www.kde.org' and 'http://www.kde.org/' // remove duplicates like 'http://www.kde.org' and 'http://www.kde.org/'
// (i.e. the trailing slash) // (i.e. the trailing slash)
// some duplicates are also created by prepending protocols // some duplicates are also created by prepending protocols
static void hp_removeDuplicates( KCompletionMatches& l ) static void hp_removeDuplicates( TDECompletionMatches& l )
{ {
TQString http = "http://"; TQString http = "http://";
TQString ftp = "ftp://ftp."; TQString ftp = "ftp://ftp.";
TQString file = "file:"; TQString file = "file:";
TQString file2 = "file://"; TQString file2 = "file://";
l.removeDuplicates(); l.removeDuplicates();
for( KCompletionMatches::Iterator it = l.begin(); for( TDECompletionMatches::Iterator it = l.begin();
it != l.end(); it != l.end();
++it ) { ++it ) {
TQString str = (*it).value(); TQString str = (*it).value();
@ -5602,9 +5602,9 @@ static void hp_removeDuplicates( KCompletionMatches& l )
} }
} }
static void hp_removeCommonPrefix( KCompletionMatches& l, const TQString& prefix ) static void hp_removeCommonPrefix( TDECompletionMatches& l, const TQString& prefix )
{ {
for( KCompletionMatches::Iterator it = l.begin(); for( TDECompletionMatches::Iterator it = l.begin();
it != l.end(); it != l.end();
) { ) {
if( (*it).value().startsWith( prefix )) { if( (*it).value().startsWith( prefix )) {
@ -5617,7 +5617,7 @@ static void hp_removeCommonPrefix( KCompletionMatches& l, const TQString& prefix
// don't include common prefixes like 'http://', i.e. when s == 'h', include // don't include common prefixes like 'http://', i.e. when s == 'h', include
// http://hotmail.com but don't include everything just starting with 'http://' // http://hotmail.com but don't include everything just starting with 'http://'
static void hp_checkCommonPrefixes( KCompletionMatches& matches, const TQString& s ) static void hp_checkCommonPrefixes( TDECompletionMatches& matches, const TQString& s )
{ {
static const char* const prefixes[] = { static const char* const prefixes[] = {
"http://", "http://",
@ -5652,7 +5652,7 @@ TQStringList KonqMainWindow::historyPopupCompletionItems( const TQString& s)
const TQString file2 = "file://"; const TQString file2 = "file://";
if( s.isEmpty()) if( s.isEmpty())
return TQStringList(); return TQStringList();
KCompletionMatches matches= s_pCompletion->allWeightedMatches( s ); TDECompletionMatches matches= s_pCompletion->allWeightedMatches( s );
hp_checkCommonPrefixes( matches, s ); hp_checkCommonPrefixes( matches, s );
bool checkDuplicates = false; bool checkDuplicates = false;
if ( !s.startsWith( ftp ) ) { if ( !s.startsWith( ftp ) ) {

@ -494,7 +494,7 @@ protected slots:
void slotCompletionModeChanged( TDEGlobalSettings::Completion ); void slotCompletionModeChanged( TDEGlobalSettings::Completion );
void slotMakeCompletion( const TQString& ); void slotMakeCompletion( const TQString& );
void slotSubstringcompletion( const TQString& ); void slotSubstringcompletion( const TQString& );
void slotRotation( KCompletionBase::KeyBindingType ); void slotRotation( TDECompletionBase::KeyBindingType );
void slotMatch( const TQString& ); void slotMatch( const TQString& );
void slotClearHistory(); void slotClearHistory();
void slotClearComboHistory(); void slotClearComboHistory();
@ -730,7 +730,7 @@ private:
static TDEConfig *s_comboConfig; static TDEConfig *s_comboConfig;
KURLCompletion *m_pURLCompletion; KURLCompletion *m_pURLCompletion;
// just a reference to KonqHistoryManager's completionObject // just a reference to KonqHistoryManager's completionObject
static KCompletion *s_pCompletion; static TDECompletion *s_pCompletion;
ToggleViewGUIClient *m_toggleViewGUIClient; ToggleViewGUIClient *m_toggleViewGUIClient;

@ -55,8 +55,8 @@ KonqHistoryManager::KonqHistoryManager( TQObject *parent, const char *name )
// take care of the completion object // take care of the completion object
m_pCompletion = new KCompletion; m_pCompletion = new TDECompletion;
m_pCompletion->setOrder( KCompletion::Weighted ); m_pCompletion->setOrder( TDECompletion::Weighted );
// and load the history // and load the history
loadHistory(); loadHistory();
@ -619,10 +619,10 @@ bool KonqHistoryManager::loadFallback()
// tries to create a small KonqHistoryEntry out of a string, where the string // tries to create a small KonqHistoryEntry out of a string, where the string
// looks like "http://www.bla.com/bla.html:23" // looks like "http://www.bla.com/bla.html:23"
// the attached :23 is the weighting from KCompletion // the attached :23 is the weighting from TDECompletion
KonqHistoryEntry * KonqHistoryManager::createFallbackEntry(const TQString& item) const KonqHistoryEntry * KonqHistoryManager::createFallbackEntry(const TQString& item) const
{ {
// code taken from KCompletion::addItem(), adjusted to use weight = 1 // code taken from TDECompletion::addItem(), adjusted to use weight = 1
uint len = item.length(); uint len = item.length();
uint weight = 1; uint weight = 1;

@ -37,7 +37,7 @@
#include <libkonq_export.h> #include <libkonq_export.h>
class KCompletion; class TDECompletion;
typedef TQPtrList<KonqHistoryEntry> KonqBaseHistoryList; typedef TQPtrList<KonqHistoryEntry> KonqBaseHistoryList;
@ -69,7 +69,7 @@ protected:
* Konqueror instance. Additionally it synchronizes the history with other * Konqueror instance. Additionally it synchronizes the history with other
* Konqueror instances via DCOP to keep one global and persistant history. * Konqueror instances via DCOP to keep one global and persistant history.
* *
* It keeps the history in sync with one KCompletion object * It keeps the history in sync with one TDECompletion object
*/ */
class LIBKONQ_EXPORT KonqHistoryManager : public KParts::HistoryProvider, class LIBKONQ_EXPORT KonqHistoryManager : public KParts::HistoryProvider,
public KonqHistoryComm public KonqHistoryComm
@ -164,9 +164,9 @@ public:
void removePending( const KURL& url ); void removePending( const KURL& url );
/** /**
* @returns the KCompletion object. * @returns the TDECompletion object.
*/ */
KCompletion * completionObject() const { return m_pCompletion; } TDECompletion * completionObject() const { return m_pCompletion; }
/** /**
* @returns the list of all history entries, sorted by date * @returns the list of all history entries, sorted by date
@ -370,7 +370,7 @@ private:
TQ_UINT32 m_maxCount; // maximum of history entries TQ_UINT32 m_maxCount; // maximum of history entries
TQ_UINT32 m_maxAgeDays; // maximum age of a history entry TQ_UINT32 m_maxAgeDays; // maximum age of a history entry
KCompletion *m_pCompletion; // the completion object we sync with TDECompletion *m_pCompletion; // the completion object we sync with
/** /**
* A timer that will emit the KParts::HistoryProvider::updated() signal * A timer that will emit the KParts::HistoryProvider::updated() signal

@ -176,7 +176,7 @@ KClassicGreeter::~KClassicGreeter()
void // virtual void // virtual
KClassicGreeter::loadUsers( const TQStringList &users ) KClassicGreeter::loadUsers( const TQStringList &users )
{ {
KCompletion *userNamesCompletion = new KCompletion; TDECompletion *userNamesCompletion = new TDECompletion;
userNamesCompletion->setItems( users ); userNamesCompletion->setItems( users );
loginEdit->setCompletionObject( userNamesCompletion ); loginEdit->setCompletionObject( userNamesCompletion );
loginEdit->setAutoDeleteCompletionObject( true ); loginEdit->setAutoDeleteCompletionObject( true );

@ -219,7 +219,7 @@ KPamGreeter::~KPamGreeter()
void // virtual void // virtual
KPamGreeter::loadUsers( const TQStringList &users ) KPamGreeter::loadUsers( const TQStringList &users )
{ {
KCompletion *userNamesCompletion = new KCompletion; TDECompletion *userNamesCompletion = new TDECompletion;
userNamesCompletion->setItems( users ); userNamesCompletion->setItems( users );
loginEdit->setCompletionObject( userNamesCompletion ); loginEdit->setCompletionObject( userNamesCompletion );
loginEdit->setAutoDeleteCompletionObject( true ); loginEdit->setAutoDeleteCompletionObject( true );

@ -243,7 +243,7 @@ void // virtual
KWinbindGreeter::loadUsers( const TQStringList &users ) KWinbindGreeter::loadUsers( const TQStringList &users )
{ {
allUsers = users; allUsers = users;
KCompletion *userNamesCompletion = new KCompletion; TDECompletion *userNamesCompletion = new TDECompletion;
loginEdit->setCompletionObject( userNamesCompletion ); loginEdit->setCompletionObject( userNamesCompletion );
loginEdit->setAutoDeleteCompletionObject( true ); loginEdit->setAutoDeleteCompletionObject( true );
loginEdit->setCompletionMode( TDEGlobalSettings::CompletionAuto ); loginEdit->setCompletionMode( TDEGlobalSettings::CompletionAuto );

Loading…
Cancel
Save