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

List:       kde-devel
Subject:    setCurrentAction question
From:       Anatoli Gorchetchnikov <anatoli () cns ! bu ! edu>
Date:       2009-03-03 12:03:31
Message-ID: 200903030703.38889.anatoli () cns ! bu ! edu
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Hi guys

question about following piece of code in 
KSelectAction::setCurrentAction(QAction* action): 
--------------
     if (action->isVisible() && action->isEnabled() && action->isCheckable())
      {
        action->setChecked(true);
        if (isCheckable())
            setChecked(true);
        return true;
      } else
        kWarning (129) << "Action does not have the correct properties to be 
current:" << action->text();
---------------

How necessary here is action->isVisible() check? Or is there a different way 
to do the following?

I have an option to automatically reload last open file on the part reload and 
also would like to check the corresponding recent file in KRecentFilesAction.

The sequence of events in my code is
create part manager
connect activePartChanged to createGUI
create necessary part
add part to manager using addPart
read part configuration including list of recent files
if option "reload last file on restart" is checked 
   and load last open file succeeds
   then check the corresponding action in recent files.

Here  setCurrentAction returns the warning above, I presume because it is not 
visible.

-- 
Regards, 
Anatoli


["signature.asc" (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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