1466 + nsCOMPtr<nsISupportsCString> str = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); |
1466 + nsCOMPtr<nsISupportsCString> str = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); |
1467 + if (!str) |
1467 + if (!str) |
1468 + return NS_ERROR_FAILURE; |
1468 + return NS_ERROR_FAILURE; |
1469 + |
1469 + |
1470 + str->SetData( NS_LITERAL_CSTRING( "ISDEFAULTBROWSER" )); |
1470 + str->SetData( NS_LITERAL_CSTRING( "ISDEFAULTBROWSER" )); |
1471 + command->AppendElement( str, false ); |
1471 + command->AppendElement( str ); |
1472 + |
1472 + |
1473 + if( nsKDEUtils::command( command )) |
1473 + if( nsKDEUtils::command( command )) |
1474 + *aIsDefaultBrowser = true; |
1474 + *aIsDefaultBrowser = true; |
1475 + return NS_OK; |
1475 + return NS_OK; |
1476 +} |
1476 +} |
1487 + nsCOMPtr<nsISupportsCString> paramstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); |
1487 + nsCOMPtr<nsISupportsCString> paramstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); |
1488 + if (!cmdstr || !paramstr) |
1488 + if (!cmdstr || !paramstr) |
1489 + return NS_ERROR_FAILURE; |
1489 + return NS_ERROR_FAILURE; |
1490 + |
1490 + |
1491 + cmdstr->SetData( NS_LITERAL_CSTRING( "SETDEFAULTBROWSER" )); |
1491 + cmdstr->SetData( NS_LITERAL_CSTRING( "SETDEFAULTBROWSER" )); |
1492 + command->AppendElement( cmdstr, false ); |
1492 + command->AppendElement( cmdstr ); |
1493 + |
1493 + |
1494 + paramstr->SetData( aClaimAllTypes ? NS_LITERAL_CSTRING( "ALLTYPES" ) : NS_LITERAL_CSTRING( "NORMAL" )); |
1494 + paramstr->SetData( aClaimAllTypes ? NS_LITERAL_CSTRING( "ALLTYPES" ) : NS_LITERAL_CSTRING( "NORMAL" )); |
1495 + command->AppendElement( paramstr, false ); |
1495 + command->AppendElement( paramstr ); |
1496 + |
1496 + |
1497 + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; |
1497 + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; |
1498 +} |
1498 +} |
1499 + |
1499 + |
1500 +NS_IMETHODIMP |
1500 +NS_IMETHODIMP |
1540 + else if( aApplication == APPLICATION_NEWS ) |
1540 + else if( aApplication == APPLICATION_NEWS ) |
1541 + str->SetData( NS_LITERAL_CSTRING( "OPENNEWS" )); |
1541 + str->SetData( NS_LITERAL_CSTRING( "OPENNEWS" )); |
1542 + else |
1542 + else |
1543 + return NS_ERROR_NOT_IMPLEMENTED; |
1543 + return NS_ERROR_NOT_IMPLEMENTED; |
1544 + |
1544 + |
1545 + command->AppendElement( str, false ); |
1545 + command->AppendElement( str ); |
1546 + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; |
1546 + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; |
1547 +} |
1547 +} |
1548 + |
1548 + |
1549 +NS_IMETHODIMP |
1549 +NS_IMETHODIMP |
1550 +nsKDEShellService::OpenApplicationWithURI(nsIFile* aApplication, const nsACString& aURI) |
1550 +nsKDEShellService::OpenApplicationWithURI(nsIFile* aApplication, const nsACString& aURI) |
1558 + nsCOMPtr<nsISupportsCString> uristr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); |
1558 + nsCOMPtr<nsISupportsCString> uristr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); |
1559 + if (!cmdstr || !appstr || !uristr) |
1559 + if (!cmdstr || !appstr || !uristr) |
1560 + return NS_ERROR_FAILURE; |
1560 + return NS_ERROR_FAILURE; |
1561 + |
1561 + |
1562 + cmdstr->SetData( NS_LITERAL_CSTRING( "RUN" )); |
1562 + cmdstr->SetData( NS_LITERAL_CSTRING( "RUN" )); |
1563 + command->AppendElement( cmdstr, false ); |
1563 + command->AppendElement( cmdstr ); |
1564 + nsAutoCString app; |
1564 + nsAutoCString app; |
1565 + nsresult rv = aApplication->GetNativePath( app ); |
1565 + nsresult rv = aApplication->GetNativePath( app ); |
1566 + NS_ENSURE_SUCCESS( rv, rv ); |
1566 + NS_ENSURE_SUCCESS( rv, rv ); |
1567 + appstr->SetData( app ); |
1567 + appstr->SetData( app ); |
1568 + command->AppendElement( appstr, false ); |
1568 + command->AppendElement( appstr ); |
1569 + uristr->SetData( aURI ); |
1569 + uristr->SetData( aURI ); |
1570 + command->AppendElement( uristr, false ); |
1570 + command->AppendElement( uristr ); |
1571 + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; |
1571 + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; |
1572 +} |
1572 +} |
1573 + |
1573 + |
1574 +NS_IMETHODIMP |
1574 +NS_IMETHODIMP |
1575 +nsKDEShellService::GetDefaultFeedReader(nsIFile** _retval) |
1575 +nsKDEShellService::GetDefaultFeedReader(nsIFile** _retval) |
1583 + nsCOMPtr<nsISupportsCString> str = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); |
1583 + nsCOMPtr<nsISupportsCString> str = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); |
1584 + if( !str ) |
1584 + if( !str ) |
1585 + return NS_ERROR_FAILURE; |
1585 + return NS_ERROR_FAILURE; |
1586 + |
1586 + |
1587 + str->SetData( NS_LITERAL_CSTRING( "GETDEFAULTFEEDREADER" )); |
1587 + str->SetData( NS_LITERAL_CSTRING( "GETDEFAULTFEEDREADER" )); |
1588 + command->AppendElement( str, false ); |
1588 + command->AppendElement( str ); |
1589 + |
1589 + |
1590 + nsCOMPtr<nsIArray> output; |
1590 + nsCOMPtr<nsIArray> output; |
1591 + if( !nsKDEUtils::command( command, getter_AddRefs( output ) ) ) |
1591 + if( !nsKDEUtils::command( command, getter_AddRefs( output ) ) ) |
1592 + return NS_ERROR_FAILURE; |
1592 + return NS_ERROR_FAILURE; |
1593 + |
1593 + |