Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    N900 directory locations

    Reply
    Sasler | # 1 | 2010-01-01, 06:28 | Report

    I'm having some really odd difficulties in locating the .sounds directory. This no doubt due my limited understanding of Linux.

    I got the following (Qt) code:

    Code:
    QString fileName = QFileDialog::getOpenFileName(this,tr("Open Sound"), "/home/user/MyDocs/.sounds", tr("Wave Files (*.wav)"));
    
    // END
    With this I get the no files/folders in Open file dialog and the directory up button is disabled. The same thing happens when pointing to /home/user/MyDocs. When I point to /home/user, I don't see the MyDocs directory but up button works.

    Can anyone please explain what I'm doing wrong? Where is the .sounds directory located?

    Thank you

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by Sasler; 2010-01-01 at 06:30.

     
    pagesix1536 | # 2 | 2010-01-01, 06:32 | Report

    looks like the correct path to me. Maybe you need the trailing forward slash? I'm shooting in the dark here...I'm no programmer.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to pagesix1536 For This Useful Post:
    Sasler

     
    Sasler | # 3 | 2010-01-01, 06:36 | Report

    Originally Posted by pagesix1536 View Post
    looks like the correct path to me. Maybe you need the trailing forward slash? I'm shooting in the dark here...I'm no programmer.
    Thanks, but it doesn't make any difference. The same result.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    jebba | # 4 | 2010-01-01, 14:33 | Report

    Ya, that PATH is correct.

    The reason they made it a "hidden" directory was so they could translate it. Like that directory *name* stays the same across all installations, but on my spanish system it says "Sonidos", for example. So they are mapping to it some other way as well, to provide translations. Also, files that begin with a dot ".", are called "hidden" files in *nix. This isn't a full answer to your question, but maybe that provides some hints that will help.

    Good luck and post the answer if you find it.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to jebba For This Useful Post:
    Sasler

     
    qwerty12 | # 5 | 2010-01-01, 18:02 | Report

    In GTK+, having the Hildon file chooser dialog open, already navigated to the .sounds directory works fine. (You can compile the attached to verify that.)

    I know **** all about Qt so I wouldn't take this seriously, but you could try:
    • Ensuring that the device is not in Mass Storage mode. ;P
    • Try setting the path after the dialog is instantiated.

    PHP Code:
    /* gcc file-chooser-example.c $(pkg-config --cflags --libs glib-2.0 gtk+-2.0 hildon-1 hildon-fm-2) -Wall */

    #include <stdlib.h>
    #include <glib.h>
    #include <gtk/gtk.h>
    #include <hildon/hildon.h>
    #include <hildon/hildon-file-chooser-dialog.h>

    static void on_file_chooser_dialog_response (GtkWidget *file_chooser_dialog, gint response_id, gpointer user_data G_GNUC_UNUSED)
    {
        if (
    response_id == GTK_RESPONSE_OK)
        {
            
    char *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_chooser_dialog));
            
    GtkWidget *note = hildon_note_new_information (GTK_WINDOW (file_chooser_dialog), filename);
            
    gtk_dialog_run (GTK_DIALOG (note));
            
    gtk_widget_destroy (note);
            
    g_free (filename);
        }

        
    gtk_widget_destroy (file_chooser_dialog);
        
    gtk_main_quit ();
    }

    int main (int argc, char* argv[])
    {
        
    GtkWidget *file_chooser_dialog;
        
    GtkFileFilter *file_chooser_filter;

        
    g_assert (g_file_test ("/home/user/MyDocs/.sounds", G_FILE_TEST_IS_DIR));

        
    hildon_gtk_init (&argc, &argv);

        
    file_chooser_dialog = hildon_file_chooser_dialog_new (NULL, GTK_FILE_CHOOSER_ACTION_OPEN);
        
    gtk_window_set_title (GTK_WINDOW (file_chooser_dialog), "Open Sound");
        
    gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (file_chooser_dialog), "/home/user/MyDocs/.sounds");
        
    file_chooser_filter = gtk_file_filter_new ();
        
    /* gtk_file_filter_set_name (file_chooser_filter, "Wave Files"); */ /* No point with the HildonFileChooserDialog... */
        
    gtk_file_filter_add_pattern (file_chooser_filter, "*.wav");
        
    gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (file_chooser_dialog), file_chooser_filter);
        
    gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (file_chooser_dialog), file_chooser_filter);

        
    g_signal_connect (G_OBJECT (file_chooser_dialog), "response", G_CALLBACK (on_file_chooser_dialog_response), NULL);
        
    gtk_widget_show_all (file_chooser_dialog);

        
    gtk_main ();

        return 
    EXIT_SUCCESS;
    } 

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by qwerty12; 2010-01-01 at 18:05.
    The Following User Says Thank You to qwerty12 For This Useful Post:
    Sasler

     
    raulh39 | # 6 | 2010-07-26, 14:08 | Report

    Do you launch your application with the "user" user?

    Maybe you are using QtCreator. If you use QtCreator, the application gets launched with the "developer" user, wich, I think so, can't read /home/user/MyDocs/.sounds.

    Try to exec your application from an xterm...

    HTH,
    Raul.

    Edit | Forward | Quote | Quick Reply | Thanks

     
vBulletin® Version 3.8.8
Normal Logout