Exemple #1
0
void Tab::loadUrl(const std::string& url)
{
    std::string fixedUrl(url);
    if (!hasValidPrefix(fixedUrl)) {
        if (std::ifstream(fixedUrl.c_str()))
            fixedUrl.insert(0, "file:///");
        else
            fixedUrl.insert(0, "http://");
    }

    std::cout << "Load URL: " << fixedUrl << std::endl;
    WKURLRef wkUrl = WKURLCreateWithUTF8CString(fixedUrl.c_str());
    WKPageLoadURL(m_page, wkUrl);
    WKRelease(wkUrl);
}
int main(int argc, char *argv[])
{
    KAboutData aboutData( "kdirstat", "KDirStat",
			  VERSION, description, KAboutData::License_GPL,
			  "(c) 1999-2008 Stefan Hundhammer", 0, 0,
			  "*****@*****.**" );
    
    aboutData.addAuthor( "Stefan Hundhammer",
			 I18N_NOOP("\n"
				   "If you have any comments or if you would simply like to tell\n"
				   "your opinion about this program, please use \n"
				   "\"Send Feedback Mail\" from the \"Help\" menu.\n"
				   "\n"
				   "Any feedback (even negative!) is appreciated." ),
			 "*****@*****.**",
			 "http://kdirstat.sourceforge.net/" );

    aboutData.addCredit( "SequoiaView Team",
			 I18N_NOOP( "for showing just how useful treemaps really can be." ),
			 0,	// e-mail
			 "http://www.win.tue.nl/sequoiaview" );

    aboutData.addCredit( "Jarke J. van Wijk, Huub van de Wetering, Mark Bruls",
			 I18N_NOOP( "for their papers about treemaps." ),
			 "*****@*****.**",
			 "http://www.win.tue.nl/~vanwijk/" );

    aboutData.addCredit( "Ben Shneiderman",
			 I18N_NOOP( "for his ingenious idea of treemaps -\n"
				    "a truly intuitive way of visualizing tree contents." ),
			 "",	// E-Mail
			 "http://www.cs.umd.edu/hcil/treemaps/" );

    aboutData.setTranslator( "", "" ); // Default KDE templates don't apply - better leave it empty

    KCmdLineArgs::init( argc, argv, &aboutData );
    KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.

    KApplication app;

    
    if ( app.isRestored() )
    {
	RESTORE( KDirStatApp );
    }
    else
    {
	KDirStatApp *kdirstat = new KDirStatApp();
	kdirstat->show();

	KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

	if ( args->count() )
	{
	    // Process command line arguments as URLs or paths to scan

	    KURL url = fixedUrl( args->arg( 0 ) );
	    // kdDebug() << "Opening " << url.url() << endl;
	    kdirstat->openURL( url );
	}
	else
	{
	    kdirstat->fileAskOpenDir();
	}

	args->clear();
    }

    // kdDebug() << "Entering main loop" << endl;

    return app.exec();
}