-I think that I fixed the annoying bug when the scrollbar jumped back after creating a new terminal.

-Also deleted the replicated drag and drop stuff from konsole.C - now it is in the TEWidget.

svn path=/trunk/kdebase/konsole/; revision=53962
wilder-portage
Lotzi Boloni 26 years ago
parent 37623c76e4
commit 9f3d58429e
  1. 4
      include/konsole.h
  2. 81
      src/konsole.C

@ -60,7 +60,6 @@ private slots:
void opt_menu_activated(int item);
void schema_menu_activated(int item);
void pixmap_menu_activated(int item);
// void drop_menu_activated(int item);
void keytab_menu_activated(int item);
void tecRef();
void newSession(int kind);
@ -79,8 +78,7 @@ protected:
void readGlobalProperties(KConfig* config);
// Dnd
void dragEnterEvent(QDragEnterEvent* event);
void dropEvent(QDropEvent* event);
//void dragEnterEvent(QDragEnterEvent* event);
private slots:

@ -390,81 +390,6 @@ void Konsole::setColLin(int columns, int lines)
adjustSize();
}
/* ------------------------------------------------------------------------- */
/* */
/* Drag & Drop */
/* */
/* ------------------------------------------------------------------------- */
void Konsole::dragEnterEvent(QDragEnterEvent* e)
{
e->accept(QTextDrag::canDecode(e) ||
QUriDrag::canDecode(e));
}
// XXXXXXXXX is this still used ?
void Konsole::dropEvent(QDropEvent* event)
{
// The current behaviour when url(s) are dropped is
// * if there is only ONE url and if it's a LOCAL one, ask for paste or cd
// * in all other cases, just paste
// (for non-local ones, or for a list of URLs, 'cd' is nonsense)
QStrList strlist;
KURL *url;
int file_count = 0;
dropText = "";
bool bPopup = true;
if(QUriDrag::decode(event, strlist)) {
if (strlist.count()) {
for(const char* p = strlist.first(); p; p = strlist.next()) {
if(file_count++ > 0) {
dropText += " ";
bPopup = false; // more than one file, don't popup
}
url = new KURL( QString(p) );
if (url->isLocalFile()) {
dropText += url->path(); // local URL : remove protocol
}
else {
dropText += p;
bPopup = false; // a non-local file, don't popup
}
delete url;
}
if (bPopup)
m_drop->popup(pos() + event->pos());
else
se->getEmulation()->sendString(dropText.latin1());
}
}
else if(QTextDrag::decode(event, dropText))
se->getEmulation()->sendString(dropText.latin1()); // Paste it
}
/*
unused apparently (David)
void Konsole::drop_menu_activated(int item)
{
switch (item)
{
case 0: // paste
se->getEmulation()->sendString(dropText);
break;
case 1: // cd ...
{
se->getEmulation()->sendString("cd ");
QString text = KURL( dropText ).directory( true, false );
text.replace(QRegExp(" "), "\\ "); // escape spaces
se->getEmulation()->sendString(text);
se->getEmulation()->sendString("\n");
}
break;
}
}
*/
/* ------------------------------------------------------------------------- */
/* */
/* */
@ -970,7 +895,11 @@ void Konsole::newSession(int i)
s->setSchemaNo(schmno);
s->setTitle(txt);
s->setHistory(b_scroll); //FIXME: take from schema
setHistory(b_scroll); //FIXME: take from schema
// Lotzi B: I don't know why it was here, but commenting it out
// fixes the annoying bug of the jumping of the scrollbar when
// creating a new menu
//setHistory(b_scroll); //FIXME: take from schema
addSession(s);
runSession(s); // activate and run

Loading…
Cancel
Save