Changeset View
Changeset View
Standalone View
Standalone View
krusader/Panel/panelfunc.cpp
Show First 20 Lines • Show All 500 Lines • ▼ Show 20 Line(s) | 476 | { | |||
---|---|---|---|---|---|
501 | KrViewer::edit(editPath); | 501 | KrViewer::edit(editPath); | ||
502 | } | 502 | } | ||
503 | 503 | | |||
504 | void ListPanelFunc::askEditFile() | 504 | void ListPanelFunc::askEditFile() | ||
505 | { | 505 | { | ||
506 | // ask the user for the filename to edit | 506 | // ask the user for the filename to edit | ||
507 | const QUrl filePath = KChooseDir::getFile(i18n("Enter the filename to edit:"), | 507 | const QUrl filePath = KChooseDir::getFile(i18n("Enter the filename to edit:"), | ||
508 | QUrl(panel->getCurrentName()), panel->virtualPath()); | 508 | QUrl(panel->getCurrentName()), panel->virtualPath()); | ||
509 | if(filePath.isEmpty()) | 509 | if (filePath.isEmpty()) { | ||
510 | return ; // the user canceled | 510 | return; // the user canceled | ||
511 | } | ||||
511 | 512 | | |||
512 | if (filePath.isLocalFile()) { | 513 | if (filePath.isLocalFile()) { | ||
513 | // if the file exists, edit it instead of creating a new one | 514 | // if the file exists, edit it instead of creating a new one | ||
514 | QFile file(filePath.toLocalFile()); | 515 | QFile file(filePath.toLocalFile()); | ||
515 | if (file.exists()) { | 516 | if (file.exists()) { | ||
516 | editFile(filePath); | 517 | editFile(filePath); | ||
517 | return; | 518 | return; | ||
518 | } else { | 519 | } else { | ||
Show All 37 Lines | 546 | if (job->error() == KIO::ERR_DOES_NOT_EXIST) { | |||
556 | return; | 557 | return; | ||
557 | } else { | 558 | } else { | ||
558 | KMessageBox::error(nullptr, job->errorString()); | 559 | KMessageBox::error(nullptr, job->errorString()); | ||
559 | return; | 560 | return; | ||
560 | } | 561 | } | ||
561 | } | 562 | } | ||
562 | 563 | | |||
563 | if (statJob->statResult().isDir()) { | 564 | if (statJob->statResult().isDir()) { | ||
564 | KMessageBox::error(nullptr, i18n("You cannot edit a folder")); | 565 | KMessageBox::sorry(nullptr, i18n("You cannot edit a folder")); | ||
565 | return; | 566 | return; | ||
566 | } | 567 | } | ||
567 | 568 | | |||
568 | KrViewer::edit(url); | 569 | KrViewer::edit(url); | ||
569 | } | 570 | } | ||
570 | 571 | | |||
571 | void ListPanelFunc::slotFileCreated(KJob *job, const QUrl filePath) | 572 | void ListPanelFunc::slotFileCreated(KJob *job, const QUrl filePath) | ||
572 | { | 573 | { | ||
▲ Show 20 Lines • Show All 759 Lines • Show Last 20 Lines |