Author: jflesch
Date: 2007-01-27 21:01:08 +0000 (Sat, 27 Jan 2007)
New Revision: 11634

Modified:
   trunk/apps/Thaw/src/thaw/plugins/index/FileTable.java
   trunk/apps/Thaw/src/thaw/plugins/index/SearchResult.java
   trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueueTableModel.java
Log:
Hopefully should fix some refresh problems in the QueueWatcher plugion

Modified: trunk/apps/Thaw/src/thaw/plugins/index/FileTable.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/FileTable.java       2007-01-27 
20:50:57 UTC (rev 11633)
+++ trunk/apps/Thaw/src/thaw/plugins/index/FileTable.java       2007-01-27 
21:01:08 UTC (rev 11634)
@@ -575,8 +575,10 @@

                        if (columnToSort == modelIndex)
                                sortAsc = !sortAsc;
-                       else
+                       else {
                                columnToSort = modelIndex;
+                               sortAsc = true;
+                       }


                        for (int i = 0; i < columnsCount; i++) {

Modified: trunk/apps/Thaw/src/thaw/plugins/index/SearchResult.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/SearchResult.java    2007-01-27 
20:50:57 UTC (rev 11633)
+++ trunk/apps/Thaw/src/thaw/plugins/index/SearchResult.java    2007-01-27 
21:01:08 UTC (rev 11634)
@@ -72,6 +72,9 @@

        public Vector getFileList(String col, boolean asc) {

+               if (col == null)
+                       col = "filename";
+
                Vector v = new Vector();

                synchronized(db.dbLock) {
@@ -80,7 +83,8 @@

                                st = 
db.getConnection().prepareStatement("SELECT id, filename, publicKey, localPath, 
mime, size, indexParent "+
                                                                         "FROM 
files "+
-                                                                        "WHERE 
"+getWhereClause(true)+" ORDER by filename");
+                                                                        "WHERE 
"+getWhereClause(true)+" ORDER by "+col+ (asc ? "" : " DESC"));
+
                                fillInStatement(st);

                                ResultSet set = st.executeQuery();
@@ -105,7 +109,7 @@
        }

        public Vector getLinkList(String col, boolean asc) {
-                               Vector v = new Vector();
+               Vector v = new Vector();

                synchronized(db.dbLock) {
                        try {

Modified: trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueueTableModel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueueTableModel.java  
2007-01-27 20:50:57 UTC (rev 11633)
+++ trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueueTableModel.java  
2007-01-27 21:01:08 UTC (rev 11634)
@@ -280,15 +280,18 @@
        }

        public synchronized void update(final Observable o, final Object arg) {
-               int i;
+               int oldPos = -1;
+               int i = 0;

                if (queries != null && (i = queries.indexOf(o)) >= 0) {
-                       this.notifyObservers(i);
+                       oldPos = i;
                }

                sortTable();

-               if( (i = queries.indexOf(o)) >= 0) {
+               if( queries != null && (i = queries.indexOf(o)) >= 0) {
+                       if (oldPos != i)
+                               this.notifyObservers(oldPos);
                        this.notifyObservers(i);
                        return;
                }
@@ -312,7 +315,7 @@
                                return;
                        }

-                       if(queries.contains(query)) {
+                       if(queries.contains(query)) { // then it's a removing
                                removeQuery(query);
                                return;
                        }


Reply via email to