Why are methods like KIO::open_RenameDialog(), not called KIO::RenameDialog::open()?

Richard Dale richard_dale at tipitina.demon.co.uk
Thu May 31 10:22:16 BST 2007


In the KIO:: namespace there are various methods that are named like the above 
one, and I'm not sure why they aren't defined as static methods in the class 
named after the underscore, like this:

namespace KIO {
...

class KIO_EXPORT RenameDialog : public QDialog
{
...

static KIO_EXPORT RenameDialog_Result open( const QString & caption,
                                 const KUrl& src, const KUrl & dest,
                                 RenameDialog_Mode mode, QString& newDestPath,
                                 KIO::filesize_t sizeSrc = 
(KIO::filesize_t) -1,
                                 KIO::filesize_t sizeDest = 
(KIO::filesize_t) -1,
                                 time_t ctimeSrc = (time_t) -1,
                                 time_t ctimeDest = (time_t) -1,
                                 time_t mtimeSrc = (time_t) -1,
                                 time_t mtimeDest = (time_t) -1
                                 );
}
...

}

I ask because in language like C# and Java methods always have to be in a 
class, even if they are static. So C++ methods in namespaces must be moved 
into some sort of class. In this case for C#, I will probably need to move 
the C++ open_RenameDialog() to a C# RenameDialog.Open() method to get it to 
work, and it would be easier if I didn't have to.

-- Richard




More information about the kde-core-devel mailing list