[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kexi] src/plugins/forms: Forms: remove loaded form's data before switching from the data mode;
From:       Jaroslaw Staniek <staniek () kde ! org>
Date:       2016-02-29 23:12:17
Message-ID: E1aaWzB-0000sv-Rm () scm ! kde ! org
[Download RAW message or body]

Git commit c515aaed002b8a51035e1a8374fe00972a1f5997 by Jaroslaw Staniek.
Committed on 29/02/2016 at 23:07.
Pushed by staniek into branch 'master'.

Forms: remove loaded form's data before switching from the data mode; the data would \
be invalid next time, no sense to keep it

This fixes issue with data not updated after the source gets changed in the designer

M  +5    -1    src/plugins/forms/kexiformview.cpp
M  +1    -1    src/plugins/forms/kexiformview.h

http://commits.kde.org/kexi/c515aaed002b8a51035e1a8374fe00972a1f5997

diff --git a/src/plugins/forms/kexiformview.cpp b/src/plugins/forms/kexiformview.cpp
index 5fd7978..96406db 100644
--- a/src/plugins/forms/kexiformview.cpp
+++ b/src/plugins/forms/kexiformview.cpp
@@ -1,6 +1,6 @@
 /* This file is part of the KDE project
    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
-   Copyright (C) 2004-2011 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2004-2016 Jarosław Staniek <staniek@kde.org>
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
@@ -477,6 +477,10 @@ KexiFormView::beforeSwitchTo(Kexi::ViewMode mode, bool \
                *dontStore)
                 = QPoint(d->scrollView->horizontalScrollBar()->value(), \
d->scrollView->verticalScrollBar()->value());  }
     }
+    if (viewMode() == Kexi::DataViewMode) {
+        //old data won't be needed nor valid
+        d->scrollView->setData(0, false);
+    }
 
     // we don't store on db, but in our TempData
     *dontStore = true;
diff --git a/src/plugins/forms/kexiformview.h b/src/plugins/forms/kexiformview.h
index 16b05f2..a50bf10 100644
--- a/src/plugins/forms/kexiformview.h
+++ b/src/plugins/forms/kexiformview.h
@@ -1,6 +1,6 @@
 /* This file is part of the KDE project
    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
-   Copyright (C) 2004-2011 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2004-2016 Jarosław Staniek <staniek@kde.org>
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic