]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/urlnavigator.cpp
Reanimated drag & drop support again after introducing the DolphinController. It...
[dolphin.git] / src / urlnavigator.cpp
index 6ab73976a8c474d6f64b6492378dd6ad056ae2ae..d7c586961c632c72c510e61af5f5eee110426b24 100644 (file)
@@ -16,7 +16,7 @@
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
  ***************************************************************************/
 
 #include "urlnavigator.h"
@@ -136,7 +136,7 @@ void UrlNavigator::setUrl(const KUrl& url)
 {
     QString urlStr(url.pathOrUrl());
     //kDebug() << "setUrl(" << url << ")" << endl;
-    if (urlStr.at(0) == '~') {
+    if ( urlStr.length() > 0 && urlStr.at(0) == '~') {
         // replace '~' by the home directory
         urlStr.remove(0, 1);
         urlStr.insert(0, QDir::home().path());
@@ -203,7 +203,7 @@ KUrl UrlNavigator::url(int index) const
     QString path(url().pathOrUrl());
     path = path.section('/', 0, index);
 
-    if (path.at(path.length()-1) != '/')
+    if ( path.length() >= 1 && path.at(path.length()-1) != '/')
     {
         path.append('/');
     }
@@ -447,7 +447,7 @@ void UrlNavigator::slotClicked()
 void UrlNavigator::updateHistoryElem()
 {
     assert(m_historyIndex >= 0);
-    const KFileItem* item = m_dolphinView->currentFileItem();
+    const KFileItem* item = 0; // TODO: m_dolphinView->currentFileItem();
     if (item != 0) {
         m_history[m_historyIndex].setCurrentFileName(item->name());
     }
@@ -470,7 +470,7 @@ void UrlNavigator::updateContent()
 
     m_toggleButton->setToolTip(QString());
     QString path(url().pathOrUrl());
-    const KAction* action = dolphinView()->mainWindow()->actionCollection()->action("editable_location");
+    const QAction* action = dolphinView()->mainWindow()->actionCollection()->action("editable_location");
     // TODO: registry of default shortcuts
     QString shortcut = action? action->shortcut().toString() : "Ctrl+L";
     if (m_toggleButton->isChecked()) {