diff --git a/kio/kio/kfileitem.cpp b/kio/kio/kfileitem.cpp
index 482c4b6..54520d5 100644
--- a/kio/kio/kfileitem.cpp
+++ b/kio/kio/kfileitem.cpp
@@ -1307,13 +1307,12 @@ bool KFileItem::cmp( const KFileItem & item ) const
 
 bool KFileItem::operator==(const KFileItem& other) const
 {
-    // is this enough?
-    return d == other.d;
+    return d == other.d || d->m_url == other.d->m_url;
 }
 
 bool KFileItem::operator!=(const KFileItem& other) const
 {
-    return d != other.d;
+    return !operator==(other);
 }
 
 #ifndef KDE_NO_DEPRECATED
diff --git a/kio/kio/kfileitem.h b/kio/kio/kfileitem.h
index fe7ea29..9177a45 100644
--- a/kio/kio/kfileitem.h
+++ b/kio/kio/kfileitem.h
@@ -491,15 +491,21 @@ public:
     /**
      * Somewhat like a comparison operator, but more explicit,
      * and it can detect that two kfileitems are equal even when they do
-     * not share the same internal pointer - e.g. when KDirLister compares
+     * not share the same URL - e.g. when KDirLister compares
      * fileitems after listing a directory again, to detect changes.
      * @param item the item to compare
      * @return true if all values are equal
      */
     bool cmp( const KFileItem & item ) const;
 
+    /**
+     * Returns true if both items share the same URL.
+     */
     bool operator==(const KFileItem& other) const;
 
+    /**
+     * Returns true if both items do not share the same URL.
+     */
     bool operator!=(const KFileItem& other) const;
 
 
@@ -646,6 +652,8 @@ private:
 private:
     KIO_EXPORT friend QDataStream & operator<< ( QDataStream & s, const KFileItem & a );
     KIO_EXPORT friend QDataStream & operator>> ( QDataStream & s, KFileItem & a );
+
+    friend class KFileItemTest;
 };
 
 Q_DECLARE_METATYPE(KFileItem)
diff --git a/kio/tests/kfileitemtest.cpp b/kio/tests/kfileitemtest.cpp
index fa88af7..13d8d3f 100644
--- a/kio/tests/kfileitemtest.cpp
+++ b/kio/tests/kfileitemtest.cpp
@@ -105,14 +105,18 @@ void KFileItemTest::testDetach()
     QCOMPARE(fileItem2.extraData(this), (const void*)this);
 #endif
     QVERIFY(fileItem == fileItem2);
+    QVERIFY(fileItem.d == fileItem2.d);
     fileItem2.mark();
     QVERIFY(fileItem2.isMarked());
     QVERIFY(!fileItem.isMarked());
-    QVERIFY(fileItem != fileItem2);
+    QVERIFY(fileItem == fileItem2);
+    QVERIFY(fileItem.d != fileItem2.d);
 
     fileItem = fileItem2;
     QVERIFY(fileItem2.isMarked());
     QVERIFY(fileItem == fileItem2);
+    QVERIFY(fileItem.d == fileItem2.d);
+    QVERIFY(!(fileItem != fileItem2));
 }
 
 void KFileItemTest::testBasic()
@@ -246,7 +250,8 @@ void KFileItemTest::testCmp()
 
     KFileItem fileItem(KFileItem::Unknown, KFileItem::Unknown, KUrl(file.fileName()), true /*on demand*/);
     KFileItem fileItem2(KFileItem::Unknown, KFileItem::Unknown, KUrl(file.fileName()), false);
-    QVERIFY(fileItem != fileItem2); // created independently so not 'equal'
+    QVERIFY(fileItem == fileItem2); // created independently, but still 'equal'
+    QVERIFY(!(fileItem != fileItem2));
     QVERIFY(fileItem.cmp(fileItem2));
 }
 
