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

List:       kde-devel
Subject:    Re: porting from kde 1.x to 3.x
From:       David Bishop <tech () bishop ! dhs ! org>
Date:       2002-07-31 15:11:25
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 30 July 2002 05:07 pm, David Faure wrote:
> On Wednesday 31 July 2002 00:39, David Bishop wrote:
> > You can probably see the problem right off the bat.  Well, the compiler
> > did ;-)  I can't just do "errors.first.prepend" (overloaded not supported
> > by dump_expr?).  Do I need to peel the first off into another string,
> > prepend m_str, and push it back on the front?  That seems akward...  Or
> > am I confusing my languages again, and should be using ->, or ::, or
> > %^#<, :-P
>
> The latter ;)

Aha! Pounding on the keyboard *is* useful (for more than just writing perl ;-).  
Well, another day, another problem.  But before I begin, I'd like to say I've 
ported/fixed 19 out of 24 files so far, so the end is near...

1. The documentation of KStandardDirs seems to be incomplete*.  Twice they 
reference "locate()" and "locateLocal()", and even have links, but the links 
point to nowhere.  This is a problem, as I think those are what I need for the 
following snippet:

QDir adir(KApplication::localkdedir() + "/share/apps/kmamerun");
    if (!adir.exists() && !adir.mkdir(adir.absPath())) {
		if (!debugFlag.isEmpty())
			fprintf(stderr,"Cannot create directory %s\n",
			        adir.absPath().data());
		return false;
    }

Problem #1 is that localkdedir is no longer a function of KApplication (not that 
that's documented in the porting docs!).  The second is when I change that to
KStandardDirs, it comes back with "gamelist.cpp:95: cannot call member 
function `KStandardDirs::localkdedir() const' without object "  Which seems
reasonable, except I don't know what object it wants, and that too isn't documented.
As always, if this should just be thrown out, and rewritten, I'm amenable to that
too...

2.  I *think* that this might be obsoleted completely, but again, the docs don't state :-)
Specifically, menu bars no longer have a menuBarPos() method, or even anything
close to it.  Same with barPos().  If in fact this is now handled automatically by
QT (session state or something) then I'll write that up and put it in the porting docs.
I'm compiling a list of stuff to do like that...  If it isn't obsolete, then an explanation
of what I need to change would be appreciated, and be put word-for-word into
the porting docs as well...

void KMameRunApp::saveOptions()
{
	config->setGroup("General Options");
	config->writeEntry("Geometry", size());
	config->writeEntry("Show Toolbar", toolBar()->isVisible());
	config->writeEntry("Show Statusbar",statusBar()->isVisible());
	config->writeEntry("MenuBarPos", (int) menuBar()->menuBarPos());
	config->writeEntry("ToolBarPos", (int) toolBar()->barPos());
	config->writeEntry("Recent Files", recentFiles);
}

3.  Handling of show/hide wrt menu and tool bars has changed.  The following doesn't work,
and I'll be daggoned if I can figure out what needs to go in there.  Any thoughts on the
matter will be appreciated, and rolled into the documentation.

if( viewMenu->isItemChecked(ID_VIEW_TOOLBAR))
{
	viewMenu->setItemChecked(ID_VIEW_TOOLBAR, false);
	enableToolBar(KToolBar::Hide);
}
else
{
	viewMenu->setItemChecked(ID_VIEW_TOOLBAR, true);
	enableToolBar(KToolBar::Show);
}

Well, thanks all around, and if I don't respond right away, its because I'm closing on my 
house.  Anyone wanna throw about $100K my way? It shore would be appreciated B-)
	
*http://developer.kde.org/documentation/library/3.0-api/classref/kdecore/KStandardDirs.html
- -- 
A mouse is a device used to point at the xterm you want to type in. 
  --Kim Alm, a.s.r 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9R/4fEHLN/FXAbC0RAmkhAJ9eIAJpf+Rr5FOnZDIj3dN/Rgiy6wCfbABN
pywbeTtlgSVOcETxSgpaKSA=
=A1kA
-----END 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