summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2004-12-28 23:17:43 (UTC)
committer llornkcor <llornkcor>2004-12-28 23:17:43 (UTC)
commite2d6f156eacc312f270a1b5c3830e58be8941460 (patch) (unidiff)
tree85cc827910cd5617f01de4ded6cbc302ffd73bfe
parent47b3f934ed4f5d84356b5b052aed018dc97ab6a7 (diff)
downloadopie-e2d6f156eacc312f270a1b5c3830e58be8941460.zip
opie-e2d6f156eacc312f270a1b5c3830e58be8941460.tar.gz
opie-e2d6f156eacc312f270a1b5c3830e58be8941460.tar.bz2
fix compile
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEWidget.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp
index 3cb1c0a..5171bf1 100644
--- a/core/apps/embeddedkonsole/TEWidget.cpp
+++ b/core/apps/embeddedkonsole/TEWidget.cpp
@@ -1328,102 +1328,104 @@ void TEWidget::styleChange(QStyle &)
1328/* --------------------------------------------------------------------- */ 1328/* --------------------------------------------------------------------- */
1329 1329
1330 1330
1331void TEWidget::dragEnterEvent(QDragEnterEvent* e) 1331void TEWidget::dragEnterEvent(QDragEnterEvent* e)
1332{ 1332{
1333 e->accept(QTextDrag::canDecode(e) || 1333 e->accept(QTextDrag::canDecode(e) ||
1334 QUriDrag::canDecode(e)); 1334 QUriDrag::canDecode(e));
1335} 1335}
1336 1336
1337void TEWidget::dropEvent(QDropEvent* event) 1337void TEWidget::dropEvent(QDropEvent* event)
1338{ 1338{
1339 // The current behaviour when url(s) are dropped is 1339 // The current behaviour when url(s) are dropped is
1340 // * if there is only ONE url and if it's a LOCAL one, ask for paste or cd 1340 // * if there is only ONE url and if it's a LOCAL one, ask for paste or cd
1341 // * in all other cases, just paste 1341 // * in all other cases, just paste
1342 // (for non-local ones, or for a list of URLs, 'cd' is nonsense) 1342 // (for non-local ones, or for a list of URLs, 'cd' is nonsense)
1343 QStrList strlist; 1343 QStrList strlist;
1344 int file_count = 0; 1344 int file_count = 0;
1345 dropText = ""; 1345 dropText = "";
1346 bool bPopup = true; 1346 bool bPopup = true;
1347 1347
1348 if(QUriDrag::decode(event, strlist)) { 1348 if(QUriDrag::decode(event, strlist)) {
1349 if (strlist.count()) { 1349 if (strlist.count()) {
1350 for(const char* p = strlist.first(); p; p = strlist.next()) { 1350 for(const char* p = strlist.first(); p; p = strlist.next()) {
1351 if(file_count++ > 0) { 1351 if(file_count++ > 0) {
1352 dropText += " "; 1352 dropText += " ";
1353 bPopup = false; // more than one file, don't popup 1353 bPopup = false; // more than one file, don't popup
1354 } 1354 }
1355 1355
1356/* 1356/*
1357 KURL url(p); 1357 KURL url(p);
1358 if (url.isLocalFile()) { 1358 if (url.isLocalFile()) {
1359 dropText += url.path(); // local URL : remove protocol 1359 dropText += url.path(); // local URL : remove protocol
1360 } 1360 }
1361 else { 1361 else {
1362 dropText += url.prettyURL(); 1362 dropText += url.prettyURL();
1363 bPopup = false; // a non-local file, don't popup 1363 bPopup = false; // a non-local file, don't popup
1364 } 1364 }
1365*/ 1365*/
1366 1366
1367 } 1367 }
1368 1368
1369 if (bPopup) 1369 if (bPopup)
1370 // m_drop->popup(pos() + event->pos()); 1370 // m_drop->popup(pos() + event->pos());
1371 m_drop->popup(mapToGlobal(event->pos())); 1371 m_drop->popup(mapToGlobal(event->pos()));
1372 else 1372 else
1373 { 1373 {
1374 if (currentSession) { 1374 if (currentSession) {
1375 currentSession->getEmulation()->sendString(dropText.local8Bit()); 1375 currentSession->getEmulation()->sendString(dropText.local8Bit());
1376 } 1376 }
1377// kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; 1377// kdDebug() << "Drop:" << dropText.local8Bit() << "\n";
1378 } 1378 }
1379 } 1379 }
1380 } 1380 }
1381 else if(QTextDrag::decode(event, dropText)) { 1381 else if(QTextDrag::decode(event, dropText)) {
1382// kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; 1382// kdDebug() << "Drop:" << dropText.local8Bit() << "\n";
1383 if (currentSession) { 1383 if (currentSession) {
1384 currentSession->getEmulation()->sendString(dropText.local8Bit()); 1384 currentSession->getEmulation()->sendString(dropText.local8Bit());
1385 } 1385 }
1386 // Paste it 1386 // Paste it
1387 } 1387 }
1388} 1388}
1389#endif 1389#endif
1390 1390
1391 1391
1392void TEWidget::drop_menu_activated(int /*item*/) 1392void TEWidget::drop_menu_activated(int item)
1393{ 1393{
1394#ifndef QT_NO_DRAGANDDROP 1394#ifndef QT_NO_DRAGANDDROP
1395 switch (item) 1395 switch (item)
1396 { 1396 {
1397 case 0: // paste 1397 case 0: // paste
1398 currentSession->getEmulation()->sendString(dropText.local8Bit()); 1398 currentSession->getEmulation()->sendString(dropText.local8Bit());
1399// KWM::activate((Window)this->winId()); 1399// KWM::activate((Window)this->winId());
1400 break; 1400 break;
1401 case 1: // cd ... 1401 case 1: // cd ...
1402 currentSession->getEmulation()->sendString("cd "); 1402 currentSession->getEmulation()->sendString("cd ");
1403 struct stat statbuf; 1403 struct stat statbuf;
1404 if ( ::stat( QFile::encodeName( dropText ), &statbuf ) == 0 ) 1404 if ( ::stat( QFile::encodeName( dropText ), &statbuf ) == 0 )
1405 { 1405 {
1406 if ( !S_ISDIR(statbuf.st_mode) ) 1406 if ( !S_ISDIR(statbuf.st_mode) )
1407 { 1407 {
1408/* 1408/*
1409 KURL url; 1409 KURL url;
1410 url.setPath( dropText ); 1410 url.setPath( dropText );
1411 dropText = url.directory( true, false ); // remove filename 1411 dropText = url.directory( true, false ); // remove filename
1412*/ 1412*/
1413 } 1413 }
1414 } 1414 }
1415 dropText.replace(QRegExp(" "), "\\ "); // escape spaces 1415 dropText.replace(QRegExp(" "), "\\ "); // escape spaces
1416 currentSession->getEmulation()->sendString(dropText.local8Bit()); 1416 currentSession->getEmulation()->sendString(dropText.local8Bit());
1417 currentSession->getEmulation()->sendString("\n"); 1417 currentSession->getEmulation()->sendString("\n");
1418// KWM::activate((Window)this->winId()); 1418// KWM::activate((Window)this->winId());
1419 break; 1419 break;
1420 } 1420 }
1421#else
1422 Q_UNUSED(item);
1421#endif 1423#endif
1422} 1424}
1423 1425
1424void TEWidget::setWrapAt(int columns) 1426void TEWidget::setWrapAt(int columns)
1425{ 1427{
1426 vcolumns = columns; 1428 vcolumns = columns;
1427 propagateSize(); 1429 propagateSize();
1428 update(); 1430 update();
1429} 1431}