]> git.sesse.net Git - kdenlive/commitdiff
Add date column to project tree, patch by pez4brian
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 14 Nov 2011 21:06:25 +0000 (22:06 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 14 Nov 2011 21:06:25 +0000 (22:06 +0100)
http://kdenlive.org/mantis/view.php?id=2367

src/kdenlivesettings.kcfg
src/projectlist.cpp
src/projectlistview.cpp

index a2a3cb871f401f41c39f3598eb7691b7ee2d8015..4abadc83ca3f479b4928674486ab30e43ed3d209 100644 (file)
       <label>Show ratings in project tree view.</label>
       <default>false</default>
     </entry>
+    
+    <entry name="showdatecolumn" type="Bool">
+      <label>Show dates in project tree view.</label>
+      <default>false</default>
+    </entry>
 
     <entry name="frametimecode" type="Bool">
       <label>Show timecodes as frame number instead of hh:mm:ss:ff.</label>
index 9ad7bf923878401beb531d91d82eda8ff0c1b063..99238d855a342c17f49666072121ed71789a81d5 100644 (file)
@@ -1103,6 +1103,13 @@ void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties)
         item->setText(2, QString::number(f.rating()));
     }
 #endif
+
+    // Add info to date column
+    QFileInfo fileInfo(url.path());
+    if (fileInfo.exists()) {
+       item->setText(3, fileInfo.lastModified().toString(QString("yyyy/MM/dd hh:mm:ss")));
+    }
+
     // Add cut zones
     QList <CutZoneInfo> cuts = clip->cutZones();
     if (!cuts.isEmpty()) {
index 450670368024aabb093cec7b639ef13620d981ee..e08fd4b743bfba42f63893c90c6e6526bae1478d 100644 (file)
@@ -55,9 +55,9 @@ ProjectListView::ProjectListView(QWidget *parent) :
 
     setStyleSheet(style);
 
-    setColumnCount(3);
+    setColumnCount(4);
     QStringList headers;
-    headers << i18n("Clip") << i18n("Description") << i18n("Rating");
+    headers << i18n("Clip") << i18n("Description") << i18n("Rating") << i18n("Date");
     setHeaderLabels(headers);
     setIndentation(12);
     
@@ -75,6 +75,7 @@ ProjectListView::ProjectListView(QWidget *parent) :
     installEventFilter(this);
     if (!KdenliveSettings::showdescriptioncolumn()) hideColumn(1);
     if (!KdenliveSettings::showratingcolumn()) hideColumn(2);
+    if (!KdenliveSettings::showdatecolumn()) hideColumn(3);
 }
 
 ProjectListView::~ProjectListView()
@@ -113,6 +114,9 @@ void ProjectListView::configureColumns(const QPoint& pos)
         case 2:
             KdenliveSettings::setShowratingcolumn(show);
             break;
+        case 3:
+            KdenliveSettings::setShowdatecolumn(show);
+            break;
         default:
             break;
         }