Remove obsolete code. This functionality is now in KPIM::AddresseeLineEdit.

svn path=/trunk/kdepim/; revision=330601
wilder-work
Ingo Klcker 22 years ago
parent d40523bfa6
commit efbf2a4226
  1. 87
      kmcomposewin.cpp
  2. 13
      kmcomposewin.h

@ -3916,93 +3916,6 @@ void KMLineEdit::editRecentAddresses()
}
}
#if 0
//-----------------------------------------------------------------------------
void KMLineEdit::dropEvent(QDropEvent *e)
{
KURL::List uriList;
if(KURLDrag::decode( e, uriList ))
{
for (KURL::List::ConstIterator it = uriList.begin(); it != uriList.end(); ++it)
{
smartInsert( (*it).url() );
}
}
else {
if (m_useCompletion)
m_smartPaste = true;
QLineEdit::dropEvent(e);
m_smartPaste = false;
}
}
void KMLineEdit::smartInsert( const QString &str, int pos /* = -1 */ )
{
QString newText = str.stripWhiteSpace();
if (newText.isEmpty())
return;
// remove newlines in the to-be-pasted string:
newText.replace( QRegExp("\r?\n"), " " );
QString contents = text();
// determine the position where to insert the to-be-pasted string
if( ( pos < 0 ) || ( pos > (int) contents.length() ) )
pos = contents.length();
int start_sel = 0;
int end_sel = 0;
if (getSelection(&start_sel, &end_sel))
{
// Cut away the selection.
if (pos > end_sel)
pos -= (end_sel - start_sel);
else if (pos > start_sel)
pos = start_sel;
contents = contents.left(start_sel) + contents.right(end_sel+1);
}
int eot = contents.length();
// remove trailing whitespace from the contents of the line edit
while ((eot > 0) && contents[eot-1].isSpace()) eot--;
if (eot == 0)
{
contents = QString::null;
}
else if (pos >= eot)
{
if (contents[eot-1] == ',')
eot--;
contents.truncate(eot);
contents += ", ";
pos = eot+2;
}
if (newText.startsWith("mailto:"))
{
kdDebug(5006) << "Pasting '" << newText << "'" << endl;
KURL u(newText);
newText = u.path();
kdDebug(5006) << "path of mailto URL: '" << newText << "'" << endl;
// Is the mailto URL RFC 2047 encoded (cf. RFC 2368)?
if (-1 != newText.find( QRegExp("=\\?.*\\?[bq]\\?.*\\?=") ) )
newText = KMMsgBase::decodeRFC2047String( newText.latin1() );
}
else if (-1 != newText.find(" at "))
{
// Anti-spam stuff
newText.replace( " at ", "@" );
newText.replace( " dot ", "." );
}
else if (newText.contains("(at)"))
{
newText.replace( QRegExp("\\s*\\(at\\)\\s*"), "@" );
}
contents = contents.left(pos)+newText+contents.mid(pos);
setText(contents);
setEdited( true );
setCursorPosition(pos+newText.length());
}
#endif
//-----------------------------------------------------------------------------
void KMLineEdit::loadContacts()

@ -188,19 +188,6 @@ public:
protected:
// Inherited. Always called by the parent when this widget is created.
virtual void loadContacts();
/**
* Smart insertion of email addresses. If @p pos is -1 then
* @p str is inserted at the end of the current contents of this
* lineedit. Else @p str is inserted at @p pos.
* Features:
* - Automatically adds ',' if necessary to separate email addresses
* - Correctly decodes mailto URLs
* - Recognizes email addresses which are protected against address
* harvesters, i.e. "name at kde dot org" and "name(at)kde.org"
void smartInsert( const QString &str, int pos = -1 );
virtual void dropEvent(QDropEvent *e);
*/
virtual void keyPressEvent(QKeyEvent*);

Loading…
Cancel
Save