Hello again!
Recently I found, that when you open dialog "Add favourite" in query editor and close it without any changes, then in the dialog "Manage favourites" there is appears an empty element (i.e. with blank title). I think it's not quite right, so I put a small condition in dlgAddFavourite.cpp. It means that only if OK button is enabled, then we have a well-formed favourite query and can add new item to the favourites. If there will be a free time, please take a look at this patch. If I'm wrong, maybe you'll find an correct solution of the issue?
Thank you.

--
Dmitriy Olshevskiy

From 88c70e921920e40bd3ddecce469ec275d49e46af Mon Sep 17 00:00:00 2001
From: olshevskiy87 <olshevski...@bk.ru>
Date: Sun, 22 Jun 2014 21:47:25 +0400
Subject: [PATCH] don't save empty favourite queries

---
 pgadmin/dlg/dlgAddFavourite.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pgadmin/dlg/dlgAddFavourite.cpp b/pgadmin/dlg/dlgAddFavourite.cpp
index 7490987..d262a1b 100644
--- a/pgadmin/dlg/dlgAddFavourite.cpp
+++ b/pgadmin/dlg/dlgAddFavourite.cpp
@@ -105,7 +105,8 @@ int dlgAddFavourite::AddFavourite(wxString newtext)
                        ret = 0;
        }
 
-       fld->AddNewFavourite(title, newtext);
+       if (r == wxID_OK)
+               fld->AddNewFavourite(title, newtext);
        return ret;
 }
 
-- 
1.8.3.msysgit.0

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Reply via email to