avatar
Rosa has added 69e23a03d6
initial: add from SRPM
... ... --- /dev/null
... ... +++ b/.abf.yml
... ... @@ -0,0 +1,2 @@
1
sources:
2
  "kdebase-4.6.5.tar.bz2": 1a902d22956daaf380ceefe68f8db75b8b760ae6
view file @ 69e23a03d6
... ... --- /dev/null
... ... +++ b/dolphin-interface.patch
... ... @@ -0,0 +1,1614 @@
1
diff --git a/dolphin/src/dolphincontextmenu.cpp b/dolphin/src/dolphincontextmenu.cpp
2
index 7fecdfa..5cc3d4c 100644
3
--- a/dolphin/src/dolphincontextmenu.cpp
4
+++ b/dolphin/src/dolphincontextmenu.cpp
5
@@ -1,6 +1,8 @@
6
 /***************************************************************************
7
  *   Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) and              *
8
  *   Cvetoslav Ludmiloff                                                   *
9
+ *   Copyright (C) 2011 Open Solutions, Alexandr Mitin,                    *
10
+ *   teamlieder  Ivan Kulkov                                               *
11
  *                                                                         *
12
  *   This program is free software; you can redistribute it and/or modify  *
13
  *   it under the terms of the GNU General Public License as published by  *
14
@@ -32,7 +34,7 @@
15
 #include <kabstractfileitemactionplugin.h>
16
 #include <kfileitemactions.h>
17
 #include <kfileitemlistproperties.h>
18
-#include <kfileplacesmodel.h>
19
+
20
 #include <kglobal.h>
21
 #include <kiconloader.h>
22
 #include <kio/netaccess.h>
23
@@ -56,6 +58,7 @@
24
 
25
 #include "views/dolphinview.h"
26
 #include "views/viewmodecontroller.h"
27
+#include <kfileplacesmodel.h>
28
 
29
 K_GLOBAL_STATIC(KModifierKeyInfo, m_keyInfo)
30
 
31
@@ -232,95 +235,141 @@ void DolphinContextMenu::openTrashItemContextMenu()
32
 
33
 void DolphinContextMenu::openItemContextMenu()
34
 {
35
+
36
     Q_ASSERT(!m_fileInfo.isNull());
37
 
38
-    QAction* openParentInNewWindowAction = 0;
39
-    QAction* openParentInNewTabAction = 0;
40
     QAction* addToPlacesAction = 0;
41
     if (m_selectedItems.count() == 1) {
42
-        if (m_fileInfo.isDir()) {
43
-            // setup 'Create New' menu
44
-            DolphinNewFileMenu* newFileMenu = new DolphinNewFileMenu(m_mainWindow);
45
-            const DolphinView* view = m_mainWindow->activeViewContainer()->view();
46
-            newFileMenu->setViewShowsHiddenFiles(view->showHiddenFiles());
47
-            newFileMenu->checkUpToDate();
48
-            newFileMenu->setPopupFiles(m_fileInfo.url());
49
-            newFileMenu->setEnabled(selectedItemsProperties().supportsWriting());
50
-            connect(newFileMenu, SIGNAL(fileCreated(KUrl)), newFileMenu, SLOT(deleteLater()));
51
-            connect(newFileMenu, SIGNAL(directoryCreated(KUrl)), newFileMenu, SLOT(deleteLater()));
52
-
53
-            KMenu* menu = newFileMenu->menu();
54
-            menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
55
-            menu->setIcon(KIcon("document-new"));
56
-            m_popup->addMenu(menu);
57
-            m_popup->addSeparator();
58
-
59
-            // insert 'Open in new window' and 'Open in new tab' entries
60
-            m_popup->addAction(m_mainWindow->actionCollection()->action("open_in_new_window"));
61
-            m_popup->addAction(m_mainWindow->actionCollection()->action("open_in_new_tab"));
62
-
63
-            // insert 'Add to Places' entry
64
-            if (!placeExists(m_fileInfo.url())) {
65
-                addToPlacesAction = m_popup->addAction(KIcon("bookmark-new"),
66
-                                                       i18nc("@action:inmenu Add selected folder to places",
67
-                                                             "Add to Places"));
68
-            }
69
-
70
-            m_popup->addSeparator();
71
-        } else if (m_baseUrl.protocol().contains("search")) {
72
-            openParentInNewWindowAction = new QAction(KIcon("window-new"),
73
-                                                    i18nc("@action:inmenu",
74
-                                                          "Open Path in New Window"),
75
-                                                    this);
76
-            m_popup->addAction(openParentInNewWindowAction);
77
-
78
-            openParentInNewTabAction = new QAction(KIcon("tab-new"),
79
-                                                   i18nc("@action:inmenu",
80
-                                                         "Open Path in New Tab"),
81
-                                                   this);
82
-            m_popup->addAction(openParentInNewTabAction);
83
 
84
+        if (m_fileInfo.isDir()) {
85
+            m_popup->addAction(m_mainWindow->actionCollection()->action("open_item"));
86
+            QAction *act = m_mainWindow->actionCollection()->action("open_in_new_window");
87
+            act->setIcon(QIcon(""));
88
+            m_popup->addAction(act);
89
             m_popup->addSeparator();
90
+	    
91
+	    m_popup->addSeparator();
92
+	    
93
+	    QAction* addToPlacesAction = m_popup->addAction(KIcon(""),
94
+                                                  i18n("Add to Sidebar"));
95
+	    
96
+	    connect(addToPlacesAction, SIGNAL(triggered()), m_mainWindow, SLOT(slotAddToSidebar())); 
97
+	    
98
+	    // Don't show if url is already in places
99
+	    if (placeExists(m_mainWindow->activeViewContainer()->url())) {
100
+		addToPlacesAction->setVisible(false);
101
+	    }
102
         }
103
     }
104
 
105
-    insertDefaultItemActions();
106
-
107
     m_popup->addSeparator();
108
 
109
+    QAction* runAction = m_mainWindow->actionCollection()->action("run");
110
+    if (!m_fileInfo.isDir()) {
111
+        m_popup->addAction(runAction);
112
+    }
113
+    
114
     KFileItemActions fileItemActions;
115
     fileItemActions.setItemListProperties(selectedItemsProperties());
116
-    addServiceActions(fileItemActions);
117
 
118
-    addFileItemPluginActions();
119
-
120
-    addVersionControlPluginActions();
121
 
122
-    // insert 'Copy To' and 'Move To' sub menus
123
-    if (DolphinSettings::instance().generalSettings()->showCopyMoveMenu()) {
124
-        m_copyToMenu.setItems(m_selectedItems);
125
-        m_copyToMenu.setReadOnly(!selectedItemsProperties().supportsWriting());
126
-        m_copyToMenu.addActionsTo(m_popup);
127
+    if (!m_fileInfo.isDir()) { 
128
+        fileItemActions.addOpenWithActionsTo(m_popup, "DesktopEntryName != 'dolphin'");
129
+//        m_popup->insertAction(runAction, 0);
130
+    }
131
+/*
132
+    QList<QAction *> menuActions = m_popup->actions();
133
+    QList<QAction *>::iterator it = menuActions.begin();
134
+    int lc = menuActions.count();
135
+
136
+if (m_selectedItems.count() == 1) {  
137
+    it=it+2;
138
+    if (!m_fileInfo.isDir()) {
139
+      for(int j=2; j<lc-1; j++) 
140
+      {
141
+	  m_popup->removeAction(*it);
142
+	  ++it;
143
+      }
144
     }
145
+    else
146
+	  m_popup->removeAction(*it);      
147
+}
148
+    QAction *act = *it;
149
+    act->setText(i18n("Open In Program"));
150
+*/
151
+    m_popup->addSeparator();
152
+    QAction* trashAction = m_mainWindow->actionCollection()->action("move_to_trash");
153
+    m_popup->addAction(trashAction);
154
+    m_popup->addSeparator();
155
 
156
     // insert 'Properties...' entry
157
     QAction* propertiesAction = m_mainWindow->actionCollection()->action("properties");
158
     m_popup->addAction(propertiesAction);
159
 
160
+    QAction* symlinkAction = m_mainWindow->actionCollection()->action("create_symlink");
161
+    m_popup->addAction(symlinkAction);
162
+
163
+   // insert 'Actions' sub menu
164
+   int col = fileItemActions.addServiceActionsTo(m_popup);
165
+/*
166
+    menuActions = m_popup->actions();
167
+
168
+    it = menuActions.begin();
169
+
170
+    if (m_selectedItems.count() == 1) {
171
+    if (!m_fileInfo.isDir()) 
172
+	it = it+8;
173
+      else
174
+	it = it+10;
175
+      m_popup->removeAction(*it); 
176
+
177
+      it++;
178
+      act = *it;
179
+      act->setText(i18n("Create Archive"));
180
+    }
181
+*/
182
+    m_popup->addSeparator();
183
+
184
+    addFileItemPluginActions();
185
+
186
+    addVersionControlPluginActions();
187
+
188
+    insertDefaultItemActions();
189
+
190
     QAction* activatedAction = m_popup->exec(QCursor::pos());
191
+/*
192
+    QAction *action = m_popup->exec(QCursor::pos());
193
+    if (activatedAction != 0) {
194
+    if (action == addToPlacesAction) {
195
+        const KUrl& url = m_mainWindow->activeViewContainer()->url();
196
+        if (url.isValid()) {
197
+            DolphinSettings::instance().placesModel()->addPlace(i18nc("@label", "Trash"), url);
198
+        }
199
+    }    
200
+    }
201
+*/    
202
     if (activatedAction != 0) {
203
         if (activatedAction == addToPlacesAction) {
204
-            const KUrl selectedUrl(m_fileInfo.url());
205
+/*
206
+	  const KUrl selectedUrl(m_fileInfo.url());
207
             if (selectedUrl.isValid()) {
208
                 DolphinSettings::instance().placesModel()->addPlace(placesName(selectedUrl),
209
                                                                     selectedUrl);
210
+*/
211
+	  const KUrl& url = m_mainWindow->activeViewContainer()->url();
212
+	  if (url.isValid()) {
213
+	      DolphinSettings::instance().placesModel()->addPlace(i18nc("@label", "Trash"), url);
214
             }
215
-        } else if (activatedAction == openParentInNewWindowAction) {
216
+        } 
217
+/*        
218
+        else if (activatedAction == openParentInNewWindowAction) {
219
             m_command = OpenParentFolderInNewWindow;
220
         } else if (activatedAction == openParentInNewTabAction) {
221
             m_command = OpenParentFolderInNewTab;
222
         }
223
+*/
224
     }
225
+
226
 }
227
 
228
 void DolphinContextMenu::openViewportContextMenu()
229
@@ -331,56 +380,32 @@ void DolphinContextMenu::openViewportContextMenu()
230
     newFileMenu->setViewShowsHiddenFiles(view->showHiddenFiles());
231
     newFileMenu->checkUpToDate();
232
     newFileMenu->setPopupFiles(m_baseUrl);
233
-    m_popup->addMenu(newFileMenu->menu());
234
-    m_popup->addSeparator();
235
-
236
-    // Insert 'New Window' and 'New Tab' entries. Don't use "open_in_new_window" and
237
-    // "open_in_new_tab" here, as the current selection should get ignored.
238
-    m_popup->addAction(m_mainWindow->actionCollection()->action("new_window"));
239
-    m_popup->addAction(m_mainWindow->actionCollection()->action("new_tab"));
240
-
241
-    // Insert 'Add to Places' entry if exactly one item is selected
242
-    QAction* addToPlacesAction = 0;
243
-    if (!placeExists(m_mainWindow->activeViewContainer()->url())) {
244
-        addToPlacesAction = m_popup->addAction(KIcon("bookmark-new"),
245
-                                             i18nc("@action:inmenu Add current folder to places", "Add to Places"));
246
-    }
247
 
248
+    m_popup->addAction(m_mainWindow->actionCollection()->action("new_folder"));
249
     m_popup->addSeparator();
250
 
251
-    QAction* pasteAction = createPasteAction();
252
-    m_popup->addAction(pasteAction);
253
-    m_popup->addSeparator();
254
-
255
-    // Insert service actions
256
-    const KFileItemListProperties baseUrlProperties(KFileItemList() << baseFileItem());
257
-    KFileItemActions fileItemActions;
258
-    fileItemActions.setItemListProperties(baseUrlProperties);
259
-    addServiceActions(fileItemActions);
260
-
261
-    addFileItemPluginActions();
262
-
263
-    addVersionControlPluginActions();
264
-
265
-    addCustomActions();
266
-
267
     QAction* propertiesAction = m_popup->addAction(i18nc("@action:inmenu", "Properties"));
268
-    propertiesAction->setIcon(KIcon("document-properties"));
269
+    m_popup->addSeparator();
270
 
271
-    addShowMenubarAction();
272
+    KMenu* menu = new KMenu(m_mainWindow);
273
+    menu->setTitle(i18nc("@title:menu Sort By", "Sort By"));
274
+
275
+    menu->addAction(m_mainWindow->actionCollection()->action("sort_by_name"));
276
+    menu->addAction(m_mainWindow->actionCollection()->action("sort_by_date"));
277
+    menu->addAction(m_mainWindow->actionCollection()->action("sort_by_size"));
278
+    menu->addAction(m_mainWindow->actionCollection()->action("sort_by_type"));
279
+    m_popup->addMenu(menu);
280
+    
281
+    m_popup->addSeparator();    
282
+    
283
+    m_popup->addAction(createPasteAction());
284
 
285
     QAction* action = m_popup->exec(QCursor::pos());
286
     if (action == propertiesAction) {
287
         const KUrl& url = m_mainWindow->activeViewContainer()->url();
288
-
289
         KPropertiesDialog* dialog = new KPropertiesDialog(url, m_mainWindow);
290
         dialog->setAttribute(Qt::WA_DeleteOnClose);
291
         dialog->show();
292
-    } else if ((addToPlacesAction != 0) && (action == addToPlacesAction)) {
293
-        const KUrl& url = m_mainWindow->activeViewContainer()->url();
294
-        if (url.isValid()) {
295
-            DolphinSettings::instance().placesModel()->addPlace(placesName(url), url);
296
-        }
297
     }
298
 }
299
 
300
@@ -391,22 +416,17 @@ void DolphinContextMenu::insertDefaultItemActions()
301
     // Insert 'Cut', 'Copy' and 'Paste'
302
     m_popup->addAction(collection->action(KStandardAction::name(KStandardAction::Cut)));
303
     m_popup->addAction(collection->action(KStandardAction::name(KStandardAction::Copy)));
304
-    m_popup->addAction(createPasteAction());
305
-
306
-    m_popup->addSeparator();
307
+//    m_popup->addAction(collection->action(KStandardAction::name(KStandardAction::Paste)));
308
 
309
+    m_popup->addAction(createPasteAction());
310
+/*
311
+    //    act->setText(i18nc("@action:inmenu Edit", "Paste"));
312
+        act->setText(i18n("Paste"));
313
+    m_popup->addAction(act);
314
+*/
315
     // Insert 'Rename'
316
     QAction* renameAction = collection->action("rename");
317
     m_popup->addAction(renameAction);
318
-
319
-    // Insert 'Move to Trash' and/or 'Delete'
320
-    if (KGlobal::config()->group("KDE").readEntry("ShowDeleteCommand", false)) {
321
-        m_popup->addAction(collection->action("move_to_trash"));
322
-        m_popup->addAction(collection->action("delete"));
323
-    } else {
324
-        m_popup->addAction(m_removeAction);
325
-        updateRemoveAction();
326
-    }
327
 }
328
 
329
 void DolphinContextMenu::addShowMenubarAction()
330
@@ -447,7 +467,7 @@ QAction* DolphinContextMenu::createPasteAction()
331
     QAction* action = 0;
332
     const bool isDir = !m_fileInfo.isNull() && m_fileInfo.isDir();
333
     if (isDir && (m_selectedItems.count() == 1)) {
334
-        action = new QAction(KIcon("edit-paste"), i18nc("@action:inmenu", "Paste Into Folder"), this);
335
+        action = new QAction(KIcon(""), i18nc("@action:inmenu", "Paste Into Folder"), this);
336
         const QMimeData* mimeData = QApplication::clipboard()->mimeData();
337
         const KUrl::List pasteData = KUrl::List::fromMimeData(mimeData);
338
         action->setEnabled(!pasteData.isEmpty() && selectedItemsProperties().supportsWriting());
339
@@ -458,7 +478,21 @@ QAction* DolphinContextMenu::createPasteAction()
340
 
341
     return action;
342
 }
343
-
344
+/*
345
+QAction* DolphinContextMenu::createSyncAction()
346
+{
347
+  QAction* action = 0;
348
+  
349
+  if( m_selectedItems.count() > 1 ) {
350
+    action = m_mainWindow->actionCollection()->action("properties");
351
+  }
352
+  else {
353
+// Проверка файла на синхронизацию, присвоение соответствующего QAction    
354
+  }
355
+  
356
+  return action;
357
+}
358
+*/
359
 KFileItemListProperties& DolphinContextMenu::selectedItemsProperties()
360
 {
361
     if (m_selectedItemsProperties == 0) {
362
diff --git a/dolphin/src/dolphincontextmenu.h b/dolphin/src/dolphincontextmenu.h
363
index f0eee23..6537d8f 100644
364
--- a/dolphin/src/dolphincontextmenu.h
365
+++ b/dolphin/src/dolphincontextmenu.h
366
@@ -1,5 +1,7 @@
367
 /***************************************************************************
368
  *   Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at>                  *
369
+  *   Copyright (C) 2011 Open Solutions, Alexandr Mitin,                    *
370
+ *   teamlieder  Ivan Kulkov                                               *
371
  *                                                                         *
372
  *   This program is free software; you can redistribute it and/or modify  *
373
  *   it under the terms of the GNU General Public License as published by  *
374
@@ -25,6 +27,8 @@
375
 #include <kservice.h>
376
 #include <kurl.h>
377
 #include <konq_copytomenu.h>
378
+#include <kfileitemactions.h>
379
+#include <kmenu.h>
380
 
381
 #include <QtCore/QObject>
382
 
383
@@ -122,6 +126,8 @@ private:
384
     void openViewportContextMenu();
385
 
386
     void insertDefaultItemActions();
387
+    
388
+    void addOpenWithMenu();
389
 
390
     /**
391
      * Adds the "Show menubar" action to the menu if the
392
diff --git a/dolphin/src/dolphinmainwindow.cpp b/dolphin/src/dolphinmainwindow.cpp
393
index 3b5cfd8..5b8277e 100644
394
--- a/dolphin/src/dolphinmainwindow.cpp
395
+++ b/dolphin/src/dolphinmainwindow.cpp
396
@@ -2,6 +2,8 @@
397
  *   Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at>                  *
398
  *   Copyright (C) 2006 by Stefan Monov <logixoul@gmail.com>               *
399
  *   Copyright (C) 2006 by Cvetoslav Ludmiloff <ludmiloff@gmail.com>       *
400
+ *   Copyright (C) 2011 Open Solutions, Alexandr Mitin,                    *
401
+ *   teamlieder  Ivan Kulkov                                               *
402
  *                                                                         *
403
  *   This program is free software; you can redistribute it and/or modify  *
404
  *   it under the terms of the GNU General Public License as published by  *
405
@@ -58,10 +60,9 @@
406
 #include <kdesktopfile.h>
407
 #include <kdeversion.h>
408
 #include <kfiledialog.h>
409
-#include <kfileplacesmodel.h>
410
+
411
 #include <kglobal.h>
412
 #include <klineedit.h>
413
-#include <ktoolbar.h>
414
 #include <kicon.h>
415
 #include <kiconloader.h>
416
 #include <kio/netaccess.h>
417
@@ -81,10 +82,10 @@
418
 #include <kstandardaction.h>
419
 #include <ktabbar.h>
420
 #include <ktoggleaction.h>
421
-#include <kurlnavigator.h>
422
 #include <kurl.h>
423
 #include <kurlcombobox.h>
424
 #include <ktoolinvocation.h>
425
+#include <ktoolbar.h>
426
 
427
 #include <QDBusMessage>
428
 #include <QKeyEvent>
429
@@ -93,6 +94,9 @@
430
 #include <QDockWidget>
431
 #include <kacceleratormanager.h>
432
 
433
+#include <kurlnavigator.h>
434
+#include <kfileplacesmodel.h>
435
+
436
 /*
437
  * Remembers the tab configuration if a tab has been closed.
438
  * Each closed tab can be restored by the menu
439
@@ -308,6 +312,7 @@ void DolphinMainWindow::pasteIntoFolder()
440
 
441
 void DolphinMainWindow::changeUrl(const KUrl& url)
442
 {
443
+
444
     if (!KProtocolManager::supportsListing(url)) {
445
         // The URL navigator only checks for validity, not
446
         // if the URL can be listed. An error message is
447
@@ -316,19 +321,11 @@ void DolphinMainWindow::changeUrl(const KUrl& url)
448
     }
449
 
450
     DolphinViewContainer* view = activeViewContainer();
451
+
452
     if (view != 0) {
453
         view->setUrl(url);
454
-        updateEditActions();
455
-        updateViewActions();
456
-        updateGoActions();
457
-        setUrlAsCaption(url);
458
-        if (m_viewTab.count() > 1) {
459
-            m_tabBar->setTabText(m_tabIndex, squeezedText(tabName(m_activeViewContainer->url())));
460
-        }
461
-        const QString iconName = KMimeType::iconNameForUrl(url);
462
-        m_tabBar->setTabIcon(m_tabIndex, KIcon(iconName));
463
-        emit urlChanged(url);
464
     }
465
+
466
 }
467
 
468
 void DolphinMainWindow::slotEditableStateChanged(bool editable)
469
@@ -338,6 +335,20 @@ void DolphinMainWindow::slotEditableStateChanged(bool editable)
470
     editableLocationAction->setChecked(editable);
471
 }
472
 
473
+void DolphinMainWindow::slotAddToSidebar()
474
+{    const KFileItemList list = m_activeViewContainer->view()->selectedItems();
475
+    if (!list.isEmpty()) {
476
+     if ((list.count() == 1) && list[0].isDir()) {
477
+        KFileItem item = list[0];
478
+	QString name = item.url().fileName();	
479
+
480
+	if (item.url().isValid())
481
+	      DolphinSettings::instance().placesModel()->addPlace(name, item.url());	
482
+      }  
483
+    }
484
+}
485
+
486
+
487
 void DolphinMainWindow::slotSelectionChanged(const KFileItemList& selection)
488
 {
489
     updateEditActions();
490
@@ -392,6 +403,11 @@ void DolphinMainWindow::openNewMainWindow()
491
     DolphinApplication::app()->createMainWindow()->show();
492
 }
493
 
494
+void DolphinMainWindow::createNewFolder()
495
+{
496
+    newFileMenu()->createDirectory();
497
+}
498
+
499
 void DolphinMainWindow::openNewTab()
500
 {
501
     const bool isUrlEditable =  m_activeViewContainer->urlNavigator()->isUrlEditable();
502
@@ -478,13 +494,38 @@ void DolphinMainWindow::activatePrevTab()
503
     m_tabBar->setCurrentIndex(tabIndex);
504
 }
505
 
506
+void DolphinMainWindow::openItem()
507
+{
508
+    KUrl newWindowUrl;
509
+
510
+    const KFileItemList list = m_activeViewContainer->view()->selectedItems();
511
+    if (list.isEmpty()) {
512
+        newWindowUrl = m_activeViewContainer->url();
513
+    } else if ((list.count() == 1) && list[0].isDir()) {
514
+        newWindowUrl = list[0].url();
515
+    }
516
+
517
+    if (!newWindowUrl.isEmpty()) {
518
+        changeUrl(newWindowUrl);
519
+    }
520
+}
521
+
522
 void DolphinMainWindow::openInNewTab()
523
 {
524
+    KUrl newWindowUrl;
525
+
526
     const KFileItemList list = m_activeViewContainer->view()->selectedItems();
527
     if (list.isEmpty()) {
528
-        openNewTab(m_activeViewContainer->url());
529
+        newWindowUrl = m_activeViewContainer->url();
530
     } else if ((list.count() == 1) && list[0].isDir()) {
531
-        openNewTab(list[0].url());
532
+        newWindowUrl = list[0].url();
533
+    }
534
+
535
+    if (!newWindowUrl.isEmpty()) {
536
+
537
+        DolphinMainWindow* window = DolphinApplication::app()->createMainWindow();
538
+        window->changeUrl(newWindowUrl);
539
+        window->show();
540
     }
541
 }
542
 
543
@@ -855,6 +896,14 @@ void DolphinMainWindow::toggleEditLocation()
544
     urlNavigator->setUrlEditable(action->isChecked());
545
 }
546
 
547
+void DolphinMainWindow::toggleShowLocation()
548
+{
549
+    clearStatusBar();
550
+
551
+    KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator();
552
+    urlNavigator->setUrlEditable(true);
553
+}
554
+
555
 void DolphinMainWindow::replaceLocation()
556
 {
557
     KUrlNavigator* navigator = m_activeViewContainer->urlNavigator();
558
@@ -985,7 +1034,8 @@ void DolphinMainWindow::compareFiles()
559
 void DolphinMainWindow::toggleShowMenuBar()
560
 {
561
     const bool visible = menuBar()->isVisible();
562
-    menuBar()->setVisible(!visible);
563
+//    menuBar()->setVisible(!visible);
564
+    menuBar()->setVisible(false);
565
 }
566
 
567
 void DolphinMainWindow::openTerminal()
568
@@ -1371,6 +1421,127 @@ void DolphinMainWindow::init()
569
     }
570
 
571
     m_showMenuBar->setChecked(!menuBar()->isHidden());  // workaround for bug #171080
572
+
573
+    initToolBar();
574
+    menuBar()->setVisible(false);
575
+}
576
+
577
+void DolphinMainWindow::initToolBar()
578
+{
579
+    KToolBar *tToolbar = new KToolBar(this);
580
+    
581
+    QMenu *toolsMenu = new QMenu(this);
582
+    
583
+    QAction *km = actionCollection()->action("new_window");
584
+    km->setIcon(KIcon(""));
585
+    km->setShortcut(QKeySequence());
586
+
587
+    toolsMenu->addAction(km);
588
+    toolsMenu->addSeparator();
589
+
590
+    km =  actionCollection()->addAction("find_file");
591
+    km->setText(i18nc("@action:intoolbar", "Find File"));
592
+    connect(km, SIGNAL(triggered()), this, SLOT(find()));
593
+    
594
+    toolsMenu->addAction(actionCollection()->action("find_file"));
595
+    toolsMenu->addSeparator();
596
+    
597
+    QAction* showLocation = actionCollection()->addAction("show_location");
598
+    showLocation->setText(i18nc("@action:intoolbar", "Show Location"));
599
+    connect(showLocation, SIGNAL(triggered()), this, SLOT(toggleShowLocation()));    
600
+    
601
+    toolsMenu->addAction(actionCollection()->action("show_location"));
602
+    toolsMenu->addAction(actionCollection()->action("show_hidden_files"));
603
+    toolsMenu->addSeparator();
604
+    
605
+    QMenu* settingsActionMenu = new QMenu(i18nc("@action:intoolbar", "Settings"), this);
606
+
607
+    km = KStandardAction::preferences(this, SLOT(editSettings()), actionCollection());
608
+    km->setText(i18nc("@action:intoolbar", "Configure Dolphin"));
609
+    km->setIcon(KIcon(""));    
610
+    settingsActionMenu->addAction(km);
611
+    
612
+    km = actionCollection()->action("options_configure_keybinding");
613
+    km->setText(i18nc("@action:intoolbar", "Configure Keybindings"));
614
+    km->setIcon(KIcon(""));
615
+    settingsActionMenu->addAction(km);
616
+    km = actionCollection()->action("view_properties");
617
+    km->setText(i18nc("@action:intoolbar", "View Properties"));
618
+    settingsActionMenu->addAction(km);
619
+    toolsMenu->addMenu(settingsActionMenu);
620
+
621
+    QMenu* helpActionMenu = new QMenu(i18n("Help"), this);
622
+
623
+    km = actionCollection()->action("help_about_app");
624
+    km->setText(i18nc("@action:intoolbar", "About Dolphin"));
625
+    km->setIcon(KIcon(""));
626
+    helpActionMenu->addAction(km);
627
+    km = actionCollection()->action("help_contents");
628
+    km->setText(i18nc("@action:intoolbar","Help Contents"));
629
+    km->setIcon(KIcon(""));
630
+    helpActionMenu->addAction(km);
631
+    toolsMenu->addMenu(helpActionMenu);
632
+   
633
+    QToolButton *button = new QToolButton(this);
634
+    button->setIcon(KIcon("applications-system"));
635
+    button->setPopupMode(QToolButton::MenuButtonPopup);
636
+    button->setMenu(toolsMenu);
637
+    button->setArrowType(Qt::NoArrow);
638
+    button->setPopupMode(QToolButton::InstantPopup);
639
+    tToolbar->addWidget(button);
640
+    
641
+    tToolbar->setLayoutDirection(Qt::RightToLeft);  
642
+    button->setLayoutDirection(Qt::LeftToRight);
643
+
644
+    toolBar()->addAction(actionCollection()->action("view_mode"));
645
+    
646
+    addToolBar(Qt::TopToolBarArea, tToolbar);
647
+}
648
+
649
+void DolphinMainWindow::slotToolsAction()
650
+{
651
+    QMenu *toolsMenu = new QMenu(this);
652
+    
653
+    QAction *km = actionCollection()->action("new_window");
654
+    km->setIcon(KIcon(""));
655
+    km->setShortcut(QKeySequence());
656
+
657
+    toolsMenu->addAction(km);
658
+    toolsMenu->addSeparator();
659
+
660
+    toolsMenu->addAction(actionCollection()->action("find_file"));
661
+    toolsMenu->addSeparator();
662
+
663
+    toolsMenu->addAction(actionCollection()->action("show_location"));
664
+    km = actionCollection()->action("show_hidden_files");
665
+    toolsMenu->addAction(static_cast<KToggleAction*>(km));
666
+    toolsMenu->addAction(actionCollection()->action("show_hidden_files"));
667
+    toolsMenu->addSeparator();
668
+    
669
+    QMenu* settingsActionMenu = new QMenu(i18nc("@action:intoolbar", "Settings"), this);
670
+
671
+    km = KStandardAction::preferences(this, SLOT(editSettings()), actionCollection());
672
+    km->setIcon(KIcon(""));    
673
+    settingsActionMenu->addAction(km);
674
+    
675
+    km = actionCollection()->action("options_configure_keybinding");
676
+    km->setIcon(KIcon(""));
677
+    settingsActionMenu->addAction(km);
678
+    settingsActionMenu->addAction(actionCollection()->action("view_properties"));
679
+    toolsMenu->addMenu(settingsActionMenu);
680
+
681
+
682
+    QMenu* helpActionMenu = new QMenu(i18n("Help"), this);
683
+
684
+    km = actionCollection()->action("help_about_app");
685
+    km->setIcon(KIcon(""));    
686
+    helpActionMenu->addAction(km);
687
+    km = actionCollection()->action("help_contents");
688
+    km->setIcon(KIcon(""));    
689
+    helpActionMenu->addAction(km);
690
+    toolsMenu->addMenu(helpActionMenu);
691
+
692
+    toolsMenu->show();
693
 }
694
 
695
 void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContainer)
696
@@ -1412,7 +1583,7 @@ void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContain
697
 void DolphinMainWindow::setupActions()
698
 {
699
     // setup 'File' menu
700
-    m_newFileMenu = new DolphinNewFileMenu(this);
701
+    m_newFileMenu = new DolphinNewFileMenu(this, this);
702
     KMenu* menu = m_newFileMenu->menu();
703
     menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
704
     menu->setIcon(KIcon("document-new"));
705
@@ -1438,6 +1609,10 @@ void DolphinMainWindow::setupActions()
706
     closeTab->setEnabled(false);
707
     connect(closeTab, SIGNAL(triggered()), this, SLOT(closeTab()));
708
 
709
+    KAction* newFolder = actionCollection()->addAction("new_folder");
710
+    newFolder->setText(i18nc("@action:inmenu Folder", "New Folder"));
711
+    connect(newFolder, SIGNAL(triggered()), this, SLOT(createNewFolder()));    
712
+    
713
     KStandardAction::quit(this, SLOT(quit()), actionCollection());
714
 
715
     // setup 'Edit' menu
716
@@ -1451,12 +1626,16 @@ void DolphinMainWindow::setupActions()
717
     KShortcut cutShortcut = cut->shortcut();
718
     cutShortcut.remove(Qt::SHIFT + Qt::Key_Delete, KShortcut::KeepEmpty);
719
     cut->setShortcut(cutShortcut);
720
-    KStandardAction::copy(this, SLOT(copy()), actionCollection());
721
+    cut->setIcon(KIcon(""));
722
+    KAction* copy = KStandardAction::copy(this, SLOT(copy()), actionCollection());
723
+    copy->setIcon(KIcon(""));    
724
+//    KStandardAction::copy(this, SLOT(copy()), actionCollection());
725
     KAction* paste = KStandardAction::paste(this, SLOT(paste()), actionCollection());
726
     // The text of the paste-action is modified dynamically by Dolphin
727
     // (e. g. to "Paste One Folder"). To prevent that the size of the toolbar changes
728
     // due to the long text, the text "Paste" is used:
729
-    paste->setIconText(i18nc("@action:inmenu Edit", "Paste"));
730
+    paste->setIcon(KIcon(""));
731
+//    paste->setText(i18nc("@action:inmenu Edit", "Paste"));
732
 
733
     KStandardAction::find(this, SLOT(find()), actionCollection());
734
 
735
@@ -1580,6 +1759,11 @@ void DolphinMainWindow::setupActions()
736
     openInNewWindow->setText(i18nc("@action:inmenu", "Open in New Window"));
737
     openInNewWindow->setIcon(KIcon("window-new"));
738
     connect(openInNewWindow, SIGNAL(triggered()), this, SLOT(openInNewWindow()));
739
+
740
+    KAction* openItem = actionCollection()->addAction("open_item");
741
+    openItem->setText(i18nc("@action:inmenu", "Open"));
742
+    connect(openItem, SIGNAL(triggered()), this, SLOT(openItem()));
743
+
744
 }
745
 
746
 void DolphinMainWindow::setupDockWidgets()
747
diff --git a/dolphin/src/dolphinmainwindow.h b/dolphin/src/dolphinmainwindow.h
748
index 9a57b54..2f89bf7 100644
749
--- a/dolphin/src/dolphinmainwindow.h
750
+++ b/dolphin/src/dolphinmainwindow.h
751
@@ -2,6 +2,8 @@
752
  *   Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at>                  *
753
  *   Copyright (C) 2006 by Stefan Monov <logixoul@gmail.com>               *
754
  *   Copyright (C) 2006 by Cvetoslav Ludmiloff <ludmiloff@gmail.com>       *
755
+ *   Copyright (C) 2011 Open Solutions, Alexandr Mitin,                    *
756
+ *   teamlieder  Ivan Kulkov                                               *
757
  *                                                                         *
758
  *   This program is free software; you can redistribute it and/or modify  *
759
  *   it under the terms of the GNU General Public License as published by  *
760
@@ -123,6 +125,10 @@ public:
761
     KAction* showMenuBarAction() const;
762
 
763
 public slots:
764
+      void slotToolsAction();
765
+      void createNewFolder();
766
+      void slotAddToSidebar();
767
+  
768
     /**
769
      * Pastes the clipboard data into the currently selected folder
770
      * of the active view. If not exactly one folder is selected,
771
@@ -176,6 +182,8 @@ protected:
772
 
773
     /** @see KMainWindow::readProperties() */
774
     virtual void readProperties(const KConfigGroup& group);
775
+    
776
+//    KToolBar *tToolbar;
777
 
778
 private slots:
779
     void clearStatusBar();
780
@@ -257,6 +265,8 @@ private slots:
781
      */
782
     void toggleEditLocation();
783
 
784
+    void toggleShowLocation();
785
+    
786
     /**
787
      * Switches to the edit mode of the navigation bar and selects
788
      * the whole URL, so that it can be replaced by the user. If the edit mode is
789
@@ -350,7 +360,9 @@ private slots:
790
      */
791
     void openInNewTab();
792
 
793
-    /**
794
+    void openItem();
795
+
796
+	 /**
797
      * Opens the selected folder in a new window.
798
      */
799
     void openInNewWindow();
800
@@ -445,6 +457,7 @@ private slots:
801
 private:
802
     DolphinMainWindow(int id);
803
     void init();
804
+    void initToolBar();
805
 
806
     /**
807
      * Activates the given view, which means that
808
diff --git a/dolphin/src/dolphinnewfilemenu.cpp b/dolphin/src/dolphinnewfilemenu.cpp
809
index 14379a3..c7ffb78 100644
810
--- a/dolphin/src/dolphinnewfilemenu.cpp
811
+++ b/dolphin/src/dolphinnewfilemenu.cpp
812
@@ -29,9 +29,9 @@
813
 #include <kactioncollection.h>
814
 #include <kio/job.h>
815
 
816
-DolphinNewFileMenu::DolphinNewFileMenu(DolphinMainWindow* parent) :
817
-    KNewFileMenu(parent->actionCollection(), "create_new", parent),
818
-    m_mainWin(parent)
819
+DolphinNewFileMenu::DolphinNewFileMenu(QWidget* parent, DolphinMainWindow* mainWin) :
820
+    KNewFileMenu(mainWin->actionCollection(), "create_new", parent),
821
+    m_mainWin(mainWin)
822
 {
823
     DolphinNewFileMenuObserver::instance().attach(this);
824
 }
825
diff --git a/dolphin/src/dolphinnewfilemenu.h b/dolphin/src/dolphinnewfilemenu.h
826
index bc6f6be..e13f388 100644
827
--- a/dolphin/src/dolphinnewfilemenu.h
828
+++ b/dolphin/src/dolphinnewfilemenu.h
829
@@ -39,7 +39,7 @@ class DolphinNewFileMenu : public KNewFileMenu
830
     Q_OBJECT
831
 
832
 public:
833
-    DolphinNewFileMenu(DolphinMainWindow* parent);
834
+    DolphinNewFileMenu(QWidget* parent,	DolphinMainWindow* mainWin);
835
     virtual ~DolphinNewFileMenu();
836
 
837
 protected slots:
838
diff --git a/dolphin/src/dolphinui.rc b/dolphin/src/dolphinui.rc
839
index e6dd0a0..1223c43 100644
840
--- a/dolphin/src/dolphinui.rc
841
+++ b/dolphin/src/dolphinui.rc
842
@@ -1,157 +1,115 @@
843
-<!DOCTYPE kpartgui SYSTEM 'kpartgui.dtd'>
844
-<kpartgui version="13" name="dolphin">
845
- <MenuBar alreadyVisited="1">
846
-  <Menu name="file" alreadyVisited="1">
847
-   <text>&amp;File</text>
848
-   <Action name="create_new"/>
849
-   <Action name="new_window"/>
850
-   <Action name="new_tab"/>
851
-   <Action name="close_tab"/>
852
-   <Separator/>
853
-   <Action name="rename"/>
854
-   <Action name="move_to_trash"/>
855
-   <Action name="delete"/>
856
-   <Separator/>
857
-   <Action name="properties"/>
858
-   <Separator weakSeparator="1"/>
859
-   <Action name="file_quit"/>
860
-  </Menu>
861
-  <Menu name="edit" alreadyVisited="1">
862
-   <text>&amp;Edit</text>
863
-   <Action name="edit_undo"/>
864
-   <Separator weakSeparator="1"/>
865
-   <Action name="edit_cut"/>
866
-   <Action name="edit_copy"/>
867
-   <Action name="edit_paste"/>
868
-   <Separator weakSeparator="1"/>
869
-   <Action name="edit_find"/>
870
-   <Separator weakSeparator="1"/>
871
-   <Action name="select_all"/>
872
-   <Action name="invert_selection"/>
873
-  </Menu>
874
-  <Menu name="view" alreadyVisited="1">
875
-   <text>&amp;View</text>
876
-   <Action name="view_zoom_in"/>
877
-   <Action name="view_zoom_out"/>
878
-   <Separator weakSeparator="1"/>
879
-   <Action name="view_mode"/>
880
-   <Action name="sort"/>
881
-   <Action name="additional_info"/>
882
-   <Action name="show_preview"/>
883
-   <Action name="show_in_groups"/>
884
-   <Action name="show_hidden_files"/>
885
-   <Separator/>
886
-   <Action name="split_view"/>
887
-   <Action name="reload"/>
888
-   <Action name="stop"/>
889
-   <Separator/>
890
-   <Action name="panels"/>
891
-   <Menu name="navigation_bar">
892
-    <text context="@title:menu">Location Bar</text>
893
-    <Action name="editable_location"/>
894
-    <Action name="replace_location"/>
895
-   </Menu>
896
-   <Separator/>
897
-   <Action name="view_properties"/>
898
-  </Menu>
899
-  <Menu name="go" alreadyVisited="1">
900
-   <text>&amp;Go</text>
901
-   <Action name="go_up"/>
902
-   <Action name="go_back"/>
903
-   <Action name="go_forward"/>
904
-   <Action name="go_home"/>
905
-   <Separator weakSeparator="1"/>
906
-   <Action name="closed_tabs"/>
907
-  </Menu>
908
-  <Menu name="tools" alreadyVisited="1">
909
-   <text>&amp;Tools</text>
910
-   <Action name="show_filter_bar"/>
911
-   <Action name="open_terminal"/>
912
-   <Action name="compare_files"/>
913
-   <Action name="change_remote_encoding"/>
914
-  </Menu>
915
-  <Menu name="settings">
916
-   <text>&amp;Settings</text>
917
-   <Action name="options_show_menubar"/>
918
-   <Merge name="StandardToolBarMenuHandler"/>
919
-   <Merge name="KMDIViewActions"/>
920
-   <Separator weakSeparator="1"/>
921
-   <Action name="options_configure_keybinding"/>
922
-   <Action name="options_configure_toolbars"/>
923
-   <Action name="options_configure"/>
924
-  </Menu>
925
-  <Separator weakSeparator="1"/>
926
-  <Menu name="help">
927
-   <text>&amp;Help</text>
928
-   <Action name="help_contents"/>
929
-   <Action name="help_whats_this"/>
930
-   <Separator weakSeparator="1"/>
931
-   <Action name="help_report_bug"/>
932
-   <Separator weakSeparator="1"/>
933
-   <Action name="switch_application_language"/>
934
-   <Separator weakSeparator="1"/>
935
-   <Action name="help_about_app"/>
936
-   <Action name="help_about_kde"/>
937
-  </Menu>
938
- </MenuBar>
939
- <ToolBar noMerge="1" name="mainToolBar" alreadyVisited="1">
940
-  <text context="@title:menu">Main Toolbar</text>
941
-  <Action name="go_back"/>
942
-  <Action name="go_forward"/>
943
-  <Separator name="separator_0"/>
944
-  <Action name="view_mode"/>
945
-  <Separator name="separator_1"/>
946
-  <Action name="edit_find"/>
947
- </ToolBar>
948
- <State name="new_file">
949
-  <disable>
950
-   <Action name="edit_undo"/>
951
-   <Action name="edit_redo"/>
952
-   <Action name="edit_cut"/>
953
-   <Action name="edit_copy"/>
954
-   <Action name="rename"/>
955
-   <Action name="move_to_trash"/>
956
-   <Action name="delete"/>
957
-   <Action name="invert_selection"/>
958
-   <Separator/>
959
-   <Action name="go_back"/>
960
-   <Action name="go_forward"/>
961
-  </disable>
962
- </State>
963
- <State name="has_selection">
964
-  <enable>
965
-   <Action name="edit_cut"/>
966
-   <Action name="edit_copy"/>
967
-   <Action name="rename"/>
968
-   <Action name="move_to_trash"/>
969
-   <Action name="delete"/>
970
-   <Action name="invert_selection"/>
971
-  </enable>
972
- </State>
973
- <State name="has_no_selection">
974
-  <disable>
975
-   <Action name="edit_cut"/>
976
-   <Action name="edit_copy"/>
977
-   <Action name="rename"/>
978
-   <Action name="move_to_trash"/>
979
-   <Action name="delete"/>
980
-   <Action name="delete_shortcut"/>
981
-   <Action name="invert_selection"/>
982
-  </disable>
983
- </State>
984
- <ActionProperties scheme="Default">
985
-  <Action priority="0" name="go_back"/>
986
-  <Action priority="0" name="go_forward"/>
987
-  <Action priority="0" name="go_up"/>
988
-  <Action priority="0" name="go_home"/>
989
-  <Action priority="0" name="stop"/>
990
-  <Action priority="0" name="icons"/>
991
-  <Action priority="0" name="details"/>
992
-  <Action priority="0" name="columns"/>
993
-  <Action priority="0" name="view_zoom_in"/>
994
-  <Action priority="0" name="view_zoom_out"/>
995
-  <Action priority="0" name="edit_cut"/>
996
-  <Action priority="0" name="edit_copy"/>
997
-  <Action priority="0" name="edit_paste"/>
998
- </ActionProperties>
999
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
1000
+<kpartgui name="dolphin" version="13">
1001
+    <MenuBar>
1002
+        <Menu name="file">
1003
+            <Action name="create_new" />
1004
+            <Action name="new_window" />
1005
+            <Action name="new_tab" />
1006
+            <Action name="close_tab" />
1007
+            <Separator/>
1008
+            <Action name="rename" />
1009
+            <Action name="move_to_trash" />
1010
+            <Action name="delete" />
1011
+            <Separator/>
1012
+            <Action name="properties" />
1013
+        </Menu>
1014
+        <Menu name="edit">
1015
+            <Action name="select_all" />
1016
+            <Action name="invert_selection" />
1017
+        </Menu>
1018
+        <Menu name="view">
1019
+            <Action name="view_mode" />
1020
+            <Action name="sort" />
1021
+            <Action name="additional_info" />
1022
+            <Action name="show_preview" />
1023
+            <Action name="show_in_groups" />
1024
+            <Action name="show_hidden_files" />
1025
+            <Separator/>
1026
+            <Action name="split_view" />
1027
+            <Action name="reload" />
1028
+            <Action name="stop" />
1029
+            <Separator/>
1030
+            <Action name="panels" />
1031
+            <Menu name="navigation_bar">
1032
+                <text context="@title:menu">Location Bar</text>
1033
+                <Action name="editable_location" />
1034
+                <Action name="replace_location" />
1035
+            </Menu>
1036
+            <Separator/>
1037
+            <Action name="view_properties" />
1038
+        </Menu>
1039
+        <Menu name="go">
1040
+            <Action name="closed_tabs" />
1041
+        </Menu>
1042
+        <Menu name="tools">
1043
+            <Action name="show_filter_bar" />
1044
+            <Action name="open_terminal" />
1045
+            <Action name="compare_files" />
1046
+            <Action name="change_remote_encoding" />
1047
+        </Menu>
1048
+    </MenuBar>
1049
+    <State name="new_file" >
1050
+        <disable>
1051
+            <Action name="edit_undo" />
1052
+            <Action name="edit_redo" />
1053
+            <Action name="edit_cut" />
1054
+            <Action name="edit_copy" />
1055
+            <Action name="rename" />
1056
+            <Action name="move_to_trash" />
1057
+            <Action name="delete" />
1058
+            <Action name="invert_selection" />
1059
+            <Separator/>
1060
+            <Action name="go_back" />
1061
+            <Action name="go_forward" />
1062
+        </disable>
1063
+    </State>
1064
+    <State name="has_selection" >
1065
+        <enable>
1066
+            <Action name="edit_cut" />
1067
+            <Action name="edit_copy" />
1068
+            <Action name="rename" />
1069
+            <Action name="move_to_trash" />
1070
+            <Action name="delete" />
1071
+            <Action name="invert_selection" />
1072
+        </enable>
1073
+    </State>
1074
+    <State name="has_no_selection" >
1075
+        <disable>
1076
+            <Action name="edit_cut" />
1077
+            <Action name="edit_copy" />
1078
+            <Action name="rename" />
1079
+            <Action name="move_to_trash" />
1080
+            <Action name="delete" />
1081
+            <Action name="delete_shortcut" />
1082
+            <Action name="invert_selection" />
1083
+        </disable>
1084
+    </State>
1085
+    <ToolBar noMerge="1" name="mainToolBar" >
1086
+        <text context="@title:menu">Main Toolbar</text>
1087
+        <Action name="go_back" />
1088
+        <Action name="go_forward" />
1089
+        <Separator name="separator_1" />
1090
+        <Action name="icons" />
1091
+        <Action name="details" />
1092
+        <Action name="columns" />
1093
+        <Separator name="separator_0" />
1094
+        <Action name="edit_find"/>
1095
+        <Action name="show_preview" />
1096
+        <Action name="split_view" />
1097
+    </ToolBar>
1098
+    <ActionProperties scheme="Default">
1099
+        <Action priority="0" name="go_back"/>
1100
+        <Action priority="0" name="go_forward"/>
1101
+        <Action priority="0" name="go_up"/>
1102
+        <Action priority="0" name="go_home"/>
1103
+        <Action priority="0" name="stop"/>
1104
+        <Action priority="0" name="icons"/>
1105
+        <Action priority="0" name="details"/>
1106
+        <Action priority="0" name="columns"/>
1107
+        <Action priority="0" name="view_zoom_in"/>
1108
+        <Action priority="0" name="view_zoom_out"/>
1109
+        <Action priority="0" name="edit_cut"/>
1110
+        <Action priority="0" name="edit_copy"/>
1111
+        <Action priority="0" name="edit_paste"/>
1112
+    </ActionProperties>
1113
 </kpartgui>
1114
diff --git a/dolphin/src/dolphinviewcontainer.cpp b/dolphin/src/dolphinviewcontainer.cpp
1115
index 7565791..c854d57 100644
1116
--- a/dolphin/src/dolphinviewcontainer.cpp
1117
+++ b/dolphin/src/dolphinviewcontainer.cpp
1118
@@ -29,7 +29,7 @@
1119
 
1120
 #include <kdesktopfile.h>
1121
 #include <kfileitemdelegate.h>
1122
-#include <kfileplacesmodel.h>
1123
+
1124
 #include <kglobalsettings.h>
1125
 #include <klocale.h>
1126
 #include <kiconeffect.h>
1127
@@ -42,7 +42,6 @@
1128
 #include <kshell.h>
1129
 #include <kurl.h>
1130
 #include <kurlcombobox.h>
1131
-#include <kurlnavigator.h>
1132
 #include <krun.h>
1133
 
1134
 #include "dolphin_generalsettings.h"
1135
@@ -62,6 +61,9 @@
1136
 #include "views/viewmodecontroller.h"
1137
 #include "views/viewproperties.h"
1138
 
1139
+#include <kfileplacesmodel.h>
1140
+#include <kurlnavigator.h>
1141
+
1142
 DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
1143
     QWidget(parent),
1144
     m_topLayout(0),
1145
diff --git a/dolphin/src/dolphinviewcontainer.h b/dolphin/src/dolphinviewcontainer.h
1146
index d17b70a..3034c73 100644
1147
--- a/dolphin/src/dolphinviewcontainer.h
1148
+++ b/dolphin/src/dolphinviewcontainer.h
1149
@@ -26,13 +26,13 @@
1150
 #include <kglobalsettings.h>
1151
 #include <kio/job.h>
1152
 
1153
-#include <kurlnavigator.h>
1154
-
1155
 #include <QElapsedTimer>
1156
 #include <QWidget>
1157
 
1158
 #include <views/dolphinview.h>
1159
 
1160
+#include <kurlnavigator.h>
1161
+
1162
 class FilterBar;
1163
 class KUrl;
1164
 class KUrlNavigator;
1165
diff --git a/dolphin/src/panels/folders/folderspanel.cpp b/dolphin/src/panels/folders/folderspanel.cpp
1166
index 43d7b64..443ac84 100644
1167
--- a/dolphin/src/panels/folders/folderspanel.cpp
1168
+++ b/dolphin/src/panels/folders/folderspanel.cpp
1169
@@ -25,7 +25,7 @@
1170
 #include "paneltreeview.h"
1171
 #include "treeviewcontextmenu.h"
1172
 
1173
-#include <kfileplacesmodel.h>
1174
+
1175
 #include <kdirlister.h>
1176
 #include <kfileitem.h>
1177
 #include <konq_operations.h>
1178
@@ -46,6 +46,8 @@
1179
 #include <views/folderexpander.h>
1180
 #include <views/renamedialog.h>
1181
 
1182
+#include <kfileplacesmodel.h>
1183
+
1184
 FoldersPanel::FoldersPanel(QWidget* parent) :
1185
     Panel(parent),
1186
     m_setLeafVisible(false),
1187
diff --git a/dolphin/src/panels/information/informationpanelcontent.cpp b/dolphin/src/panels/information/informationpanelcontent.cpp
1188
index 6c00651..8bcf8e0 100644
1189
--- a/dolphin/src/panels/information/informationpanelcontent.cpp
1190
+++ b/dolphin/src/panels/information/informationpanelcontent.cpp
1191
@@ -22,7 +22,7 @@
1192
 #include <kdialog.h>
1193
 #include <kfileitem.h>
1194
 #include <kfilemetadatawidget.h>
1195
-#include <kfileplacesmodel.h>
1196
+
1197
 #include <kglobalsettings.h>
1198
 #include <kio/previewjob.h>
1199
 #include <kiconeffect.h>
1200
@@ -54,6 +54,8 @@
1201
 #include "phononwidget.h"
1202
 #include "pixmapviewer.h"
1203
 
1204
+#include <kfileplacesmodel.h>
1205
+
1206
 InformationPanelContent::InformationPanelContent(QWidget* parent) :
1207
     QWidget(parent),
1208
     m_item(),
1209
diff --git a/dolphin/src/settings/dolphinsettings.cpp b/dolphin/src/settings/dolphinsettings.cpp
1210
index 5b91001..7ef263b 100644
1211
--- a/dolphin/src/settings/dolphinsettings.cpp
1212
+++ b/dolphin/src/settings/dolphinsettings.cpp
1213
@@ -20,7 +20,7 @@
1214
 
1215
 #include "dolphinsettings.h"
1216
 
1217
-#include <kfileplacesmodel.h>
1218
+
1219
 #include <kcomponentdata.h>
1220
 #include <klocale.h>
1221
 #include <kstandarddirs.h>
1222
@@ -30,6 +30,8 @@
1223
 #include "dolphin_generalsettings.h"
1224
 #include "dolphin_iconsmodesettings.h"
1225
 
1226
+#include <kfileplacesmodel.h>
1227
+
1228
 class DolphinSettingsSingleton
1229
 {
1230
 public:
1231
diff --git a/dolphin/src/statusbar/dolphinstatusbar.cpp b/dolphin/src/statusbar/dolphinstatusbar.cpp
1232
index dfa5be2..0de4fa8 100644
1233
--- a/dolphin/src/statusbar/dolphinstatusbar.cpp
1234
+++ b/dolphin/src/statusbar/dolphinstatusbar.cpp
1235
@@ -186,6 +186,8 @@ void DolphinStatusBar::setMessage(const QString& msg,
1236
         // read the information.
1237
         return;
1238
     }
1239
+    
1240
+    message += + "   " + m_spaceInfo->spaceStr;
1241
 
1242
     m_messageLabel->setMessage(message, konqType);
1243
     if (type != Default) {
1244
@@ -328,6 +330,7 @@ void DolphinStatusBar::contextMenuEvent(QContextMenuEvent* event)
1245
 void DolphinStatusBar::updateSpaceInfoContent(const KUrl& url)
1246
 {
1247
     m_spaceInfo->setUrl(url);
1248
+    m_messageLabel->setMessage(message()+"   "+m_spaceInfo->spaceStr, KonqStatusBarMessageLabel::Default);
1249
 }
1250
 
1251
 void DolphinStatusBar::setZoomLevel(int zoomLevel)
1252
diff --git a/dolphin/src/statusbar/statusbarspaceinfo.cpp b/dolphin/src/statusbar/statusbarspaceinfo.cpp
1253
index a601d43..a8c071c 100644
1254
--- a/dolphin/src/statusbar/statusbarspaceinfo.cpp
1255
+++ b/dolphin/src/statusbar/statusbarspaceinfo.cpp
1256
@@ -71,10 +71,6 @@ void StatusBarSpaceInfo::hideEvent(QHideEvent* event)
1257
 
1258
 void StatusBarSpaceInfo::refresh()
1259
 {
1260
-    if (!isVisible()) {
1261
-        return;
1262
-    }
1263
-
1264
     // KDiskFreeSpace is for local paths only
1265
     if (!m_url.isLocalFile()) {
1266
         setText(i18nc("@info:status", "Unknown size"));
1267
@@ -103,7 +99,9 @@ void StatusBarSpaceInfo::refresh()
1268
     if (valuesChanged) {
1269
         setText(i18nc("@info:status Free disk space", "%1 free",
1270
                 KIO::convertSize(job.available())));
1271
-
1272
+        spaceStr = i18nc("@info:status Free disk space", "%1 free",
1273
+                KIO::convertSize(job.available()));
1274
+	
1275
         setUpdatesEnabled(false);
1276
         m_kBSize = kBSize;
1277
         setValue(kBSize > 0 ? (kBUsed * 100) / kBSize : 0);
1278
diff --git a/dolphin/src/statusbar/statusbarspaceinfo.h b/dolphin/src/statusbar/statusbarspaceinfo.h
1279
index d1858f8..4f36e5d 100644
1280
--- a/dolphin/src/statusbar/statusbarspaceinfo.h
1281
+++ b/dolphin/src/statusbar/statusbarspaceinfo.h
1282
@@ -45,6 +45,7 @@ public:
1283
 
1284
     void setUrl(const KUrl& url);
1285
     KUrl url() const;
1286
+    QString spaceStr;
1287
 
1288
 protected:
1289
     void showEvent(QShowEvent* event);
1290
diff --git a/dolphin/src/views/dolphinfileitemdelegate.cpp b/dolphin/src/views/dolphinfileitemdelegate.cpp
1291
index 80d9e7b..67fac46 100644
1292
--- a/dolphin/src/views/dolphinfileitemdelegate.cpp
1293
+++ b/dolphin/src/views/dolphinfileitemdelegate.cpp
1294
@@ -74,6 +74,8 @@ void DolphinFileItemDelegate::paint(QPainter* painter,
1295
         opt.palette = palette;
1296
     }
1297
 
1298
+    bool flag = true;
1299
+
1300
     if (dolphinModel->hasVersionData() && isNameColumn) {
1301
         // The currently shown items are under revision control. Show the current revision
1302
         // state by adding an emblem and changing the text tintColor.
1303
@@ -81,7 +83,6 @@ void DolphinFileItemDelegate::paint(QPainter* painter,
1304
         const QModelIndex revisionIndex = dolphinModel->index(dirIndex.row(), DolphinModel::Version, dirIndex.parent());
1305
         const QVariant data = dolphinModel->data(revisionIndex, Qt::DecorationRole);
1306
         const KVersionControlPlugin::VersionState state = static_cast<KVersionControlPlugin::VersionState>(data.toInt());
1307
-
1308
         adjustOptionTextColor(opt, state);
1309
 
1310
         KFileItemDelegate::paint(painter, opt, index);
1311
@@ -91,7 +92,26 @@ void DolphinFileItemDelegate::paint(QPainter* painter,
1312
             const QPixmap emblem = emblemForState(state, rect.size());
1313
             painter->drawPixmap(rect.x(), rect.y() + rect.height() - emblem.height(), emblem);
1314
         }
1315
-    } else {
1316
+        flag = false;
1317
+    } 
1318
+    
1319
+// @@@
1320
+    if( dolphinModel->data(index, Qt::UserRole).toBool() ) {
1321
+      
1322
+      KFileItemDelegate::paint(painter, opt, index);
1323
+      
1324
+      const QRect rect = iconRect(option, index);
1325
+  //    const QIcon syncIcon("/usr/share/icons/oxygen/16x16/status/task-complete.png");
1326
+  //    const QIcon syncIcon("user-desktop");
1327
+      const QPixmap pm("/usr/share/icons/oxygen/16x16/status/task-complete.png");// = syncIcon.pixmap(16, 16);
1328
+      QPixmap pmm = pm.scaled(rect.width()/4, rect.height()/4);
1329
+      QSize s = pmm.size();
1330
+      painter->drawPixmap(rect.x(), rect.y() + rect.height() - pmm.height(), pmm);
1331
+
1332
+      flag = false;
1333
+    } 
1334
+    
1335
+    if( flag ) {
1336
         KFileItemDelegate::paint(painter, opt, index);
1337
     }
1338
 }
1339
diff --git a/dolphin/src/views/dolphinmodel.cpp b/dolphin/src/views/dolphinmodel.cpp
1340
index 6474a4f..4e1e872 100644
1341
--- a/dolphin/src/views/dolphinmodel.cpp
1342
+++ b/dolphin/src/views/dolphinmodel.cpp
1343
@@ -81,6 +81,14 @@ bool DolphinModel::setData(const QModelIndex& index, const QVariant& value, int
1344
 QVariant DolphinModel::data(const QModelIndex& index, int role) const
1345
 {
1346
     switch (role) {
1347
+//@@@      
1348
+    case Qt::UserRole: {
1349
+	   const KDirModel *dirModel = qobject_cast<const KDirModel*>(index.model());
1350
+           const KFileItem item = dirModel->itemForIndex(index);
1351
+	   // Ищем URL файла в списке синхронизируемых
1352
+	   return false;	// Пока true, т. е. все файлы синхронизируются
1353
+    }
1354
+      
1355
     case KCategorizedSortFilterProxyModel::CategoryDisplayRole:
1356
         return displayRoleData(index);
1357
 
1358
diff --git a/dolphin/src/views/dolphinview.cpp b/dolphin/src/views/dolphinview.cpp
1359
index 0615120..44b67ac 100644
1360
--- a/dolphin/src/views/dolphinview.cpp
1361
+++ b/dolphin/src/views/dolphinview.cpp
1362
@@ -47,6 +47,7 @@
1363
 #include <konqmimedata.h>
1364
 #include <ktoggleaction.h>
1365
 #include <kurl.h>
1366
+#include <kfileitemactions.h>
1367
 
1368
 #include "additionalinfoaccessor.h"
1369
 #include "dolphinmodel.h"
1370
@@ -598,6 +599,14 @@ void DolphinView::renameSelectedItems()
1371
     m_assureVisibleCurrentIndex = true;
1372
 }
1373
 
1374
+void DolphinView::runSelectedItems()
1375
+{
1376
+    KFileItemList fileOpenList = selectedItems();
1377
+    KFileItemActions fileItemActions;
1378
+    fileItemActions.runPreferredApplications(fileOpenList, "DesktopEntryName != 'dolphin'"); 
1379
+}
1380
+
1381
+
1382
 void DolphinView::trashSelectedItems()
1383
 {
1384
     const KUrl::List list = simplifiedSelectedUrls();
1385
diff --git a/dolphin/src/views/dolphinview.h b/dolphin/src/views/dolphinview.h
1386
index 9190971..335b7f6 100644
1387
--- a/dolphin/src/views/dolphinview.h
1388
+++ b/dolphin/src/views/dolphinview.h
1389
@@ -364,6 +364,8 @@ public slots:
1390
      * the user must input a new name for the items.
1391
      */
1392
     void renameSelectedItems();
1393
+    
1394
+    void runSelectedItems();    
1395
 
1396
     /**
1397
      * Moves all selected items to the trash.
1398
diff --git a/dolphin/src/views/dolphinviewactionhandler.cpp b/dolphin/src/views/dolphinviewactionhandler.cpp
1399
index 9c0d33f..f5f4b57 100644
1400
--- a/dolphin/src/views/dolphinviewactionhandler.cpp
1401
+++ b/dolphin/src/views/dolphinviewactionhandler.cpp
1402
@@ -1,5 +1,7 @@
1403
 /***************************************************************************
1404
  *   Copyright (C) 2008 by David Faure <faure@kde.org>                     *
1405
+ *   Copyright (C) 2011 Open Solutions, Alexandr Mitin,                    *
1406
+ *   teamlieder  Ivan Kulkov                                               *
1407
  *                                                                         *
1408
  *   This program is free software; you can redistribute it and/or modify  *
1409
  *   it under the terms of the GNU General Public License as published by  *
1410
@@ -35,7 +37,11 @@
1411
 #include <ktoggleaction.h>
1412
 #include <krun.h>
1413
 #include <kpropertiesdialog.h>
1414
+#include <kurl.h>
1415
 
1416
+#include <qdir.h>
1417
+
1418
+#include <unistd.h>
1419
 
1420
 DolphinViewActionHandler::DolphinViewActionHandler(KActionCollection* collection, QObject* parent)
1421
     : QObject(parent),
1422
@@ -90,17 +96,25 @@ void DolphinViewActionHandler::createActions()
1423
     newDirAction->setIcon(KIcon("folder-new"));
1424
     connect(newDirAction, SIGNAL(triggered()), this, SIGNAL(createDirectory()));
1425
 
1426
+    KAction* run = m_actionCollection->addAction("run");
1427
+    run->setText(i18nc("@action:inmenu File", "Run"));
1428
+    connect(run, SIGNAL(triggered()), this, SLOT(slotRun()));
1429
+
1430
+    KAction* symlink = m_actionCollection->addAction("create_symlink");
1431
+    symlink->setText(i18nc("@action:inmenu File", "Create symlink"));
1432
+    connect(symlink, SIGNAL(triggered()), this, SLOT(slotSymlink()));    
1433
+    
1434
     // File menu
1435
 
1436
     KAction* rename = m_actionCollection->addAction("rename");
1437
     rename->setText(i18nc("@action:inmenu File", "Rename..."));
1438
     rename->setShortcut(Qt::Key_F2);
1439
-    rename->setIcon(KIcon("edit-rename"));
1440
+//    rename->setIcon(KIcon("edit-rename"));
1441
     connect(rename, SIGNAL(triggered()), this, SLOT(slotRename()));
1442
 
1443
     KAction* moveToTrash = m_actionCollection->addAction("move_to_trash");
1444
     moveToTrash->setText(i18nc("@action:inmenu File", "Move to Trash"));
1445
-    moveToTrash->setIcon(KIcon("user-trash"));
1446
+//    moveToTrash->setIcon(KIcon("user-trash"));
1447
     moveToTrash->setShortcut(QKeySequence::Delete);
1448
     connect(moveToTrash, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)),
1449
             this, SLOT(slotTrashActivated(Qt::MouseButtons, Qt::KeyboardModifiers)));
1450
@@ -125,7 +139,7 @@ void DolphinViewActionHandler::createActions()
1451
     KAction *propertiesAction = m_actionCollection->addAction( "properties" );
1452
     // Well, it's the File menu in dolphinmainwindow and the Edit menu in dolphinpart... :)
1453
     propertiesAction->setText( i18nc("@action:inmenu File", "Properties") );
1454
-    propertiesAction->setIcon(KIcon("document-properties"));
1455
+//    propertiesAction->setIcon(KIcon("document-properties"));
1456
     propertiesAction->setShortcut(Qt::ALT | Qt::Key_Return);
1457
     connect(propertiesAction, SIGNAL(triggered()), SLOT(slotProperties()));
1458
 
1459
@@ -136,6 +150,7 @@ void DolphinViewActionHandler::createActions()
1460
 
1461
     KSelectAction* viewModeActions = m_actionCollection->add<KSelectAction>("view_mode");
1462
     viewModeActions->setText(i18nc("@action:intoolbar", "View Mode"));
1463
+    viewModeActions->setIcon(KIcon("view-list-icons"));
1464
     viewModeActions->addAction(iconsAction);
1465
     viewModeActions->addAction(detailsAction);
1466
     viewModeActions->addAction(columnsAction);
1467
@@ -154,6 +169,7 @@ void DolphinViewActionHandler::createActions()
1468
     showPreview->setText(i18nc("@action:intoolbar", "Preview"));
1469
     showPreview->setToolTip(i18nc("@info", "Show preview of files and folders"));
1470
     showPreview->setIcon(KIcon("view-preview"));
1471
+    showPreview->setVisible(true);
1472
     connect(showPreview, SIGNAL(triggered(bool)), this, SLOT(togglePreview(bool)));
1473
 
1474
     KToggleAction* sortDescending = m_actionCollection->add<KToggleAction>("descending");
1475
@@ -202,6 +218,15 @@ void DolphinViewActionHandler::createActions()
1476
     KAction* adjustViewProps = m_actionCollection->addAction("view_properties");
1477
     adjustViewProps->setText(i18nc("@action:inmenu View", "Adjust View Properties..."));
1478
     connect(adjustViewProps, SIGNAL(triggered()), this, SLOT(slotAdjustViewProperties()));
1479
+/*    
1480
+    KAction* addToSync = m_actionCollection->addAction("add_to_sync");
1481
+    addToSync->setText(i18nc("@action:inmenu File", "Add To Synchronization"));
1482
+    connect(addToSync, SIGNAL(triggered()), this, SLOT(slotAddToSync()));
1483
+
1484
+    KAction* removeFromSync = m_actionCollection->addAction("remove_from_sync");
1485
+    removeFromSync->setText(i18nc("@action:inmenu File", "Remove From Synchronization"));
1486
+    connect(removeFromSync, SIGNAL(triggered()), this, SLOT(slotRemoveFromSync()));
1487
+*/
1488
 }
1489
 
1490
 QActionGroup* DolphinViewActionHandler::createAdditionalInformationActionGroup()
1491
@@ -268,6 +293,32 @@ void DolphinViewActionHandler::slotRename()
1492
     m_currentView->renameSelectedItems();
1493
 }
1494
 
1495
+void DolphinViewActionHandler::slotRun()
1496
+{
1497
+    m_currentView->runSelectedItems();
1498
+}
1499
+
1500
+void DolphinViewActionHandler::slotSymlink()
1501
+{
1502
+    QDir currentDir(m_currentView->selectedItems().at(0).url().path());
1503
+     KUrl url; 
1504
+     KFileItem fi = m_currentView->selectedItems().at(0);
1505
+
1506
+	currentDir.cdUp();
1507
+      
1508
+	url = currentDir.absolutePath();	
1509
+	
1510
+      for(int i=0; i<m_currentView->selectedItems().urlList().count(); i++ )
1511
+      {
1512
+
1513
+	KUrl tUrl = m_currentView->selectedItems().urlList().at(i);
1514
+	KUrl destUrl = tUrl;
1515
+	destUrl.setFileName(i18n("Link to ") + destUrl.fileName());
1516
+	
1517
+	symlink(tUrl.path().toLocal8Bit().data(), destUrl.path().toLocal8Bit().data());
1518
+      }
1519
+}
1520
+
1521
 void DolphinViewActionHandler::slotTrashActivated(Qt::MouseButtons, Qt::KeyboardModifiers modifiers)
1522
 {
1523
     emit actionBeingHandled();
1524
@@ -524,6 +575,9 @@ void DolphinViewActionHandler::slotProperties()
1525
 {
1526
     KPropertiesDialog* dialog = 0;
1527
     const KFileItemList list = m_currentView->selectedItems();
1528
+    
1529
+    KFileItem it = list.at(0);
1530
+    
1531
     if (list.isEmpty()) {
1532
         const KUrl url = m_currentView->url();
1533
         dialog = new KPropertiesDialog(url, m_currentView);
1534
@@ -536,3 +590,24 @@ void DolphinViewActionHandler::slotProperties()
1535
     dialog->raise();
1536
     dialog->activateWindow();
1537
 }
1538
+/*
1539
+void DolphinViewActionHandler::slotAddToSync()
1540
+{
1541
+
1542
+    const KFileItemList list = m_currentView->selectedItems();
1543
+        
1544
+    if (!list.isEmpty()) {
1545
+    emit addFilesToSync(list);
1546
+    }
1547
+}
1548
+
1549
+void DolphinViewActionHandler::slotRemoveFromSync()
1550
+{
1551
+    const KFileItemList list = m_currentView->selectedItems();  
1552
+    
1553
+   if (!list.isEmpty()) {
1554
+// Remove from sync
1555
+    emit removeFileFromSync(list.at(0).url());
1556
+    }
1557
+}
1558
+*/
1559
\ No newline at end of file
1560
diff --git a/dolphin/src/views/dolphinviewactionhandler.h b/dolphin/src/views/dolphinviewactionhandler.h
1561
index 05339ce..6a7ad9f 100644
1562
--- a/dolphin/src/views/dolphinviewactionhandler.h
1563
+++ b/dolphin/src/views/dolphinviewactionhandler.h
1564
@@ -1,5 +1,7 @@
1565
 /***************************************************************************
1566
  *   Copyright (C) 2008 by David Faure <faure@kde.org>                     *
1567
+ *   Copyright (C) 2011 Open Solutions, Alexandr Mitin,                    *
1568
+ *   teamlieder  Ivan Kulkov                                               *
1569
  *                                                                         *
1570
  *   This program is free software; you can redistribute it and/or modify  *
1571
  *   it under the terms of the GNU General Public License as published by  *
1572
@@ -73,7 +75,11 @@ public:
1573
      * Returns m_actionCollection
1574
      */
1575
     KActionCollection* actionCollection();
1576
-
1577
+/*
1578
+signals:
1579
+    void addFilesToSync(const KFileItemList& files);
1580
+    void removeFileFromSync(const KUrl& url);
1581
+*/
1582
 public Q_SLOTS:
1583
     /**
1584
      * Update all actions in the 'View' menu, i.e. those that depend on the
1585
@@ -106,6 +112,17 @@ private Q_SLOTS:
1586
      * a renaming afterwards.
1587
      */
1588
     void slotRename();
1589
+    
1590
+    /**
1591
+     * Run current application.
1592
+     */
1593
+    void slotRun();
1594
+
1595
+    /**
1596
+     * Created symbolic link of current object.
1597
+     */
1598
+    void slotSymlink();
1599
+//    void slotAddToSidebar();
1600
 
1601
     /**
1602
      * Moves the selected items of the active view to the trash.
1603
@@ -207,7 +224,10 @@ private Q_SLOTS:
1604
      * like name, size and permissions.
1605
      */
1606
     void slotProperties();
1607
-
1608
+    
1609
+//    void slotAddToSync();
1610
+//    void slotRemoveFromSync();
1611
+    
1612
 private:
1613
     /**
1614
      * Create all the actions.
view file @ 69e23a03d6
... ... --- /dev/null
... ... +++ b/dolphin-sync-fix.patch
... ... @@ -0,0 +1,1752 @@
1
diff -Nuar kdebase-4.6.5_old/dolphin/src/CMakeLists.txt kdebase-4.6.5/dolphin/src/CMakeLists.txt
2
--- kdebase-4.6.5_old/dolphin/src/CMakeLists.txt	2011-09-22 17:36:22.833275647 +0400
3
+++ kdebase-4.6.5/dolphin/src/CMakeLists.txt	2011-09-22 17:38:13.921275380 +0400
4
@@ -5,7 +5,7 @@
5
 macro_bool_to_01(Nepomuk_FOUND HAVE_NEPOMUK)
6
 configure_file(config-nepomuk.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-nepomuk.h )
7
 
8
-include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
9
+include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} /usr/include/psync)
10
 
11
 if (Nepomuk_FOUND)
12
   # Yes, Soprano includes is what we need here
13
diff -Nuar kdebase-4.6.5_old/dolphin/src/dolphincontextmenu.cpp kdebase-4.6.5/dolphin/src/dolphincontextmenu.cpp
14
--- kdebase-4.6.5_old/dolphin/src/dolphincontextmenu.cpp	2011-09-22 17:37:01.041275636 +0400
15
+++ kdebase-4.6.5/dolphin/src/dolphincontextmenu.cpp	2011-09-22 17:38:13.921275380 +0400
16
@@ -77,7 +77,8 @@
17
     m_popup(0),
18
     m_command(None),
19
     m_shiftPressed(false),
20
-    m_removeAction(0)
21
+    m_removeAction(0),
22
+    m_psyncEnabled(false)
23
 {
24
     // The context menu either accesses the URLs of the selected items
25
     // or the items itself. To increase the performance both lists are cached.
26
@@ -94,8 +95,8 @@
27
 
28
     m_removeAction = new QAction(this);
29
     connect(m_removeAction, SIGNAL(triggered()), this, SLOT(slotRemoveActionTriggered()));
30
-    connect(this, SIGNAL(getSInfoFile(const KUrl&)), m_mainWindow, SLOT(slotGetSyncFileInfo(const KUrl&)));
31
-    connect(m_mainWindow, SIGNAL(putSyncFileInfo(const KUrl&, const bool)), this, SLOT(slotputSyncFileInfo(const KUrl&, const bool)));
32
+    connect(this, SIGNAL(getSInfoFile(const KUrl&)), m_mainWindow->activeViewContainer()->view(), SLOT(slotGetSyncFileInfo(const KUrl&)));
33
+    connect(m_mainWindow, SIGNAL(putSyncFileInfo(const KUrl&, unsigned int)), this, SLOT(slotputSyncFileInfo(const KUrl&, unsigned int)));
34
     
35
     m_popup = new KMenu(m_mainWindow);
36
 }
37
@@ -299,7 +300,9 @@
38
     QAction* symlinkAction = m_mainWindow->actionCollection()->action("create_symlink");
39
     m_popup->addAction(symlinkAction);
40
 
41
-    createSyncAction();
42
+    if (m_psyncEnabled)
43
+        createSyncAction();
44
+
45
    // insert 'Actions' sub menu
46
    int col = fileItemActions.addServiceActionsTo(m_popup);
47
 
48
@@ -310,8 +313,6 @@
49
     addVersionControlPluginActions();
50
 
51
     insertDefaultItemActions();
52
-    
53
-//    createSyncAction();
54
 
55
     QAction* activatedAction = m_popup->exec(QCursor::pos());
56
 
57
@@ -436,26 +437,39 @@
58
 
59
     return action;
60
 }
61
+void DolphinContextMenu::setSyncActionsEnabled(bool enable)
62
+{
63
+    m_psyncEnabled = enable;
64
+}
65
 
66
 void DolphinContextMenu::createSyncAction()
67
-{
68
-    m_popup->addSeparator();
69
-  
70
-    if( m_selectedItems.count() > 1 ) {
71
-      m_popup->addAction(m_mainWindow->actionCollection()->action("add_to_sync"));
72
-    }  else {
73
-
74
-    const KUrl url = m_selectedItems.at(0).url();
75
-    emit getSInfoFile(url);
76
-  }
77
-}
78
-
79
-void DolphinContextMenu::slotputSyncFileInfo(const KUrl& url, const bool syncState)
80
-{
81
-  if(!syncState)
82
-    m_popup->addAction(m_mainWindow->actionCollection()->action("add_to_sync"));
83
-  else
84
-    m_popup->addAction(m_mainWindow->actionCollection()->action("remove_from_sync"));    
85
+{    
86
+    m_popup->addSeparator();  
87
+    if (this->m_mainWindow->activeViewContainer()->view()->isDirectorySyncked())
88
+    {
89
+        return;
90
+    }
91
+    if( m_selectedItems.count() > 1 )
92
+    {
93
+        m_popup->addAction(m_mainWindow->actionCollection()->action("add_to_sync"));
94
+        m_popup->addAction(m_mainWindow->actionCollection()->action("remove_from_sync"));
95
+    }
96
+    else
97
+    {
98
+        const KUrl url = m_selectedItems.at(0).url();
99
+        emit getSInfoFile(url);
100
+    }
101
+}
102
+
103
+void DolphinContextMenu::slotputSyncFileInfo(const KUrl& url, unsigned int syncState)
104
+{
105
+    switch (syncState)
106
+    {
107
+    case 0: m_popup->addAction(m_mainWindow->actionCollection()->action("add_to_sync"));
108
+            break;
109
+    case 1: m_popup->addAction(m_mainWindow->actionCollection()->action("remove_from_sync"));
110
+            break;
111
+    }
112
 }
113
 
114
 KFileItemListProperties& DolphinContextMenu::selectedItemsProperties()
115
diff -Nuar kdebase-4.6.5_old/dolphin/src/dolphincontextmenu.h kdebase-4.6.5/dolphin/src/dolphincontextmenu.h
116
--- kdebase-4.6.5_old/dolphin/src/dolphincontextmenu.h	2011-09-22 17:36:22.834275646 +0400
117
+++ kdebase-4.6.5/dolphin/src/dolphincontextmenu.h	2011-09-22 17:38:13.922275409 +0400
118
@@ -105,6 +105,10 @@
119
      */
120
     static void initializeModifierKeyInfo();
121
 
122
+    /**
123
+      * Set "Add to Syncronization/Remove from Syncronization" actions enable/disable
124
+      */
125
+    void setSyncActionsEnabled(bool);
126
 signals:
127
     void getSInfoFile(const KUrl& url);
128
     
129
@@ -125,7 +129,7 @@
130
      /**
131
      * Передача информации о статусе синхронизации файла
132
      */    
133
-    void slotputSyncFileInfo(const KUrl& url, const bool syncState);
134
+    void slotputSyncFileInfo(const KUrl& url, unsigned int syncState);
135
 
136
 private:
137
     void openTrashContextMenu();
138
@@ -226,6 +230,7 @@
139
 
140
     bool m_shiftPressed;
141
     QAction* m_removeAction; // Action that represents either 'Move To Trash' or 'Delete'
142
+    bool m_psyncEnabled;
143
 };
144
 
145
 #endif
146
diff -Nuar kdebase-4.6.5_old/dolphin/src/dolphinmainwindow.cpp kdebase-4.6.5/dolphin/src/dolphinmainwindow.cpp
147
--- kdebase-4.6.5_old/dolphin/src/dolphinmainwindow.cpp	2011-09-22 17:37:01.042275631 +0400
148
+++ kdebase-4.6.5/dolphin/src/dolphinmainwindow.cpp	2011-09-22 17:39:31.000000000 +0400
149
@@ -3,7 +3,6 @@
150
  *   Copyright (C) 2006 by Stefan Monov <logixoul@gmail.com>               *
151
  *   Copyright (C) 2006 by Cvetoslav Ludmiloff <ludmiloff@gmail.com>       *
152
  *   Copyright (C) 2011 Open Solutions, Alexandr Mitin,                    *
153
- *   teamlieder  Ivan Kulkov                                               *
154
  *                                                                         *
155
  *   This program is free software; you can redistribute it and/or modify  *
156
  *   it under the terms of the GNU General Public License as published by  *
157
@@ -62,6 +61,7 @@
158
 #include <kdesktopfile.h>
159
 #include <kdeversion.h>
160
 #include <kfiledialog.h>
161
+#include <kfileitem.h>
162
 
163
 #include <kglobal.h>
164
 #include <klineedit.h>
165
@@ -91,7 +91,10 @@
166
 #include <knotification.h>
167
 
168
 #include <QDBusMessage>
169
+#include <QDebug>
170
+#include <QDateTime>
171
 #include <QKeyEvent>
172
+#include <QString>
173
 #include <QClipboard>
174
 #include <QSplitter>
175
 #include <QDockWidget>
176
@@ -100,9 +103,13 @@
177
 #include <kurlnavigator.h>
178
 #include <kfileplacesmodel.h>
179
 
180
-#include "ipc/ipc_interface.h"
181
-#include "ipc/ipcpacket.h"
182
-#include "ipc/unixsocket.h"
183
+#include <string>
184
+#include <iostream>
185
+
186
+#include <psync/psyncd/ipc_interface.h>
187
+#include <psync/dolphin/ipc_interface.h>
188
+#include <psync/ipcpacket.h>
189
+#include <psync/unixsocket.h>
190
 
191
 /*
192
  * Remembers the tab configuration if a tab has been closed.
193
@@ -131,7 +138,9 @@
194
     m_remoteEncoding(0),
195
     m_settingsDialog(0),
196
     m_lastHandleUrlStatJob(0),
197
-    m_filterDockIsTemporaryVisible(false)
198
+    m_filterDockIsTemporaryVisible(false),
199
+    m_syncSocketTime(0),
200
+    m_psyncEnabled(false)
201
 {
202
     // Workaround for a X11-issue in combination with KModifierInfo
203
     // (see DolphinContextMenu::initializeModifierKeyInfo() for
204
@@ -160,9 +169,6 @@
205
             this, SLOT(showErrorMessage(const QString&)));
206
     connect(&DragAndDropHelper::instance(), SIGNAL(errorMessage(const QString&)),
207
             this, SLOT(showErrorMessage(const QString&)));
208
-
209
-  connectWithSocket();
210
-    
211
 }
212
 
213
 DolphinMainWindow::~DolphinMainWindow()
214
@@ -172,137 +178,6 @@
215
     DolphinApplication::app()->removeMainWindow(this);
216
 }
217
 
218
-void DolphinMainWindow::connectWithSocket()
219
-{
220
-    m_unixSocket = new UnixSocket();
221
-    if (m_unixSocket->init())
222
-    {
223
-      QString self_address(QDir::homePath() + (const char*)PROGRAM_CATALOG + (const char*)PROGRAM_NAME);
224
-
225
-        QDir dir(QDir::homePath() + (const char*)PROGRAM_CATALOG);
226
-        if (!dir.exists())
227
-            dir.mkdir(QDir::homePath() + (const char*)PROGRAM_CATALOG);
228
-
229
-        if (m_unixSocket->bind(self_address.toLocal8Bit().data()))
230
-        {
231
-            m_socketNotifier = new QSocketNotifier(m_unixSocket->getSockfd(), QSocketNotifier::Read);
232
-            connect(m_socketNotifier , SIGNAL(activated(int )), this, SLOT(receiveNotification()));
233
-        }
234
-        else
235
-        {
236
-            qDebug("Error of local socket bind");
237
-	    KNotification::event(KNotification::Notification,
238
-				  i18n("Error"),
239
-				 i18n("Synchronization service is not available"));
240
-        }
241
-    }
242
-    else
243
-    {
244
-        qDebug("Error of local socket init");
245
-	KNotification::event(KNotification::Notification,
246
-				  i18n("Error"),
247
-				 i18n("Synchronization service is not available"));
248
-    }
249
-}
250
-
251
-void DolphinMainWindow::receiveNotification()
252
-{
253
-    IPCPacket *m_pkt = NULL;
254
-    int total_bytes = m_unixSocket->bytesAvailable();
255
-    
256
-    if (m_pkt)
257
-        return;
258
-
259
-    m_pkt = new IPCPacket();
260
-    m_unixSocket->readDatagram((char*)m_pkt->readBuffer(total_bytes), total_bytes);
261
-
262
-    if( m_pkt->IsValid() && m_pkt->getType() == PUT_SYNC_FILES ) {
263
-    unsigned char* aa = m_pkt->getData();
264
-//    qDebug("111 = %s", aa);
265
-
266
-    KUrl::List urlList;
267
-    
268
-    const int buffSize = 1024;
269
-    char buff[buffSize];
270
-    memset(buff, 0, buffSize);
271
-    int c = 0;
272
-    
273
-    for(int i=0; i<strlen((char*)aa); i++)
274
-    {
275
-      if(aa[i]=='\n') {
276
-	KUrl url(buff);
277
-	urlList.append(url);
278
-	memset(buff, 0, buffSize);	
279
-	c = 0;
280
-      } else {
281
-	buff[c] = aa[i];
282
-	c++;
283
-      }
284
-    }
285
-    
286
-      emit putSyncFiles(urlList);
287
-  }
288
-    
289
-
290
-    if (m_pkt)
291
-        delete m_pkt;
292
-}
293
-
294
-void DolphinMainWindow::sendSyncMessage(int messageType, unsigned char* data, unsigned long dataLength)
295
-{
296
-    IPCPacket* pkt = IPCPacket::Create(messageType, (char*)PROGRAM_NAME, data, dataLength);
297
-
298
-    QString receiver_address(QDir::homePath() + (const char*)PROGRAM_CATALOG + (const char*)SYNCRONIZE_PROGRAM_NAME);
299
-    if (m_unixSocket->writeDatagram((const char*)pkt->getBuffer(), pkt->getSize(), receiver_address.toLocal8Bit().data()) < 0)
300
-    {
301
-        qDebug("Error of writeDatagram");
302
-        return;
303
-    }
304
-}
305
-
306
-void DolphinMainWindow::slotGetSyncFiles(const KUrl& url)
307
-{
308
-    const int buffSize = 1024;
309
-    char buffer[buffSize];
310
-    memset(buffer, 0, buffSize);
311
-    strcpy(buffer, url.path().toLocal8Bit().data());
312
-    sendSyncMessage(GET_FILES_FROM_FOLDER_COMMAND, (unsigned char*)buffer, strlen(buffer) );
313
-}
314
-
315
-void DolphinMainWindow::slotGetSyncFileInfo(const KUrl& url)
316
-{
317
-  emit getSyncFileInfo(url);
318
-}
319
-
320
-void DolphinMainWindow::slotAddFilesToSync(const KFileItemList& files)
321
-{
322
-  QString str;
323
-  KUrl::List filesList;
324
-  for(int i=0; i<files.count(); i++)
325
-  {
326
-    str.append( files.at(i).url().path() );
327
-    filesList.append(files.at(i).url());
328
-    
329
-    if( i < files.count()-1 )
330
-      str.append("\n");
331
-  }
332
-  
333
-  char *message = str.toLocal8Bit().data();
334
-
335
-  sendSyncMessage(ADD_TO_SYNC_COMMAND, (unsigned char*)message, strlen(message));
336
-  emit drawAddToSyncFiles(filesList);
337
-}
338
-
339
-void DolphinMainWindow::slotRemoveFileFromSync(const KUrl& url)
340
-{
341
-  KUrl::List files;
342
-  files.append(url);
343
-  
344
-  char *message = url.path().toLocal8Bit().data();
345
-  sendSyncMessage(REMOVE_TO_SYNC_COMMAND, (unsigned char*)message, strlen(message));
346
-  emit drawRemovedFromSyncFiles(files);
347
-}
348
-
349
 void DolphinMainWindow::openDirectories(const QList<KUrl>& dirs)
350
 {
351
     if (dirs.isEmpty()) {
352
@@ -1456,6 +1331,9 @@
353
 {
354
     QPointer<DolphinContextMenu> contextMenu = new DolphinContextMenu(this, item, url);
355
     contextMenu->setCustomActions(customActions);
356
+
357
+    contextMenu->setSyncActionsEnabled(m_psyncEnabled); //Psync path
358
+
359
     const DolphinContextMenu::Command command = contextMenu->open();
360
 
361
     switch (command) {
362
@@ -1480,6 +1358,9 @@
363
 
364
 void DolphinMainWindow::init()
365
 {
366
+    if (connectWithSocket()>0)
367
+        m_psyncEnabled = true;
368
+
369
     DolphinSettings& settings = DolphinSettings::instance();
370
 
371
     // Check whether Dolphin runs the first time. If yes then
372
@@ -1502,10 +1383,17 @@
373
     m_actionHandler = new DolphinViewActionHandler(actionCollection(), this);
374
     connect(m_actionHandler, SIGNAL(actionBeingHandled()), SLOT(clearStatusBar()));
375
     connect(m_actionHandler, SIGNAL(createDirectory()), SLOT(createDirectory()));
376
-    
377
-    connect(m_actionHandler, SIGNAL(addFilesToSync(const KFileItemList&)), this, SLOT(slotAddFilesToSync(const KFileItemList&)));    
378
-    connect(m_actionHandler, SIGNAL(removeFileFromSync(const KUrl&)), this, SLOT(slotRemoveFileFromSync(const KUrl&))); 
379
-    
380
+    if (m_psyncEnabled)
381
+    {
382
+        connect(m_actionHandler, SIGNAL(addFilesToSync(const KFileItemList&)), this, SLOT(slotAddFilesToSync(const KFileItemList&)));
383
+        connect(m_actionHandler, SIGNAL(removeFileFromSync(KFileItemList)), this, SLOT(slotRemoveFileFromSync(const KFileItemList&)));
384
+    }else
385
+    {
386
+        QAction* addToSync = actionCollection()->action("add_to_sync");
387
+        addToSync->setEnabled(false);
388
+        QAction* removeFromSync = actionCollection()->action("remove_from_sync");
389
+        removeFromSync->setEnabled(false);
390
+    }
391
     ViewProperties props(homeUrl);
392
     m_viewTab[m_tabIndex].primaryView = new DolphinViewContainer(homeUrl,
393
                                                                  m_viewTab[m_tabIndex].splitter);
394
@@ -1577,15 +1465,8 @@
395
     }
396
 
397
     m_showMenuBar->setChecked(!menuBar()->isHidden());  // workaround for bug #171080
398
-
399
-//    connect(m_activeViewContainer, SIGNAL(getSyncFiles(const KUrl&)), this, SLOT(slotGetSyncFiles(const KUrl&)));
400
-    connect(this, SIGNAL(getSyncFileInfo(const KUrl&)), m_activeViewContainer, SLOT(slotGetSyncFileInfo(const KUrl&)));
401
-    connect(m_activeViewContainer, SIGNAL(putSyncFileInfo(const KUrl&, const bool)), this, SLOT(slotputSyncFileInfo(const KUrl&, const bool)));
402
-    connect(this, SIGNAL(putSyncFiles(const KUrl::List&)), m_activeViewContainer, SLOT(slotPutSyncFiles(const KUrl::List&)));
403
-    connect(this, SIGNAL(drawRemovedFromSyncFiles(const KUrl::List&)), m_activeViewContainer, SLOT(slotDrawRemovedFromSyncFiles(const KUrl::List&)));
404
-    connect(this, SIGNAL(drawAddToSyncFiles(const KUrl::List&)), m_activeViewContainer, SLOT(slotPutSyncFiles(const KUrl::List&)));
405
     
406
-    initToolBar();
407
+    initToolBar(); //new menu
408
 }
409
 
410
 void DolphinMainWindow::initToolBar()
411
@@ -1677,9 +1558,9 @@
412
     toolBar()->addAction(actionCollection()->action("view_mode"));
413
 }
414
 
415
-void DolphinMainWindow::slotputSyncFileInfo(const KUrl& url, const bool syncState)
416
+void DolphinMainWindow::slotputSyncFileInfo(const KUrl& url, unsigned int syncState)
417
 {
418
-  emit putSyncFileInfo(url, syncState);
419
+    emit putSyncFileInfo(url, syncState);
420
 }
421
 
422
 void DolphinMainWindow::slotToolsAction()
423
@@ -2185,8 +2066,6 @@
424
     connect(container, SIGNAL(searchModeChanged(bool)),
425
             this, SLOT(slotSearchModeChanged(bool)));
426
 
427
-    connect(container, SIGNAL(getSyncFiles(const KUrl&)), this, SLOT(slotGetSyncFiles(const KUrl&)));
428
-
429
     DolphinView* view = container->view();
430
     connect(view, SIGNAL(selectionChanged(KFileItemList)),
431
             this, SLOT(slotSelectionChanged(KFileItemList)));
432
@@ -2212,6 +2091,18 @@
433
             this, SLOT(slotEditableStateChanged(bool)));
434
     connect(navigator, SIGNAL(tabRequested(const KUrl&)),
435
             this, SLOT(openNewTab(KUrl)));
436
+
437
+    //sync patch
438
+    if (m_psyncEnabled)
439
+    {
440
+        connect(this, SIGNAL(getSyncFileInfo(const KUrl&)), view, SLOT(slotGetSyncFileInfo(const KUrl&)));
441
+        connect(this, SIGNAL(putSyncFiles(const KUrl::List&)), view, SLOT(slotPutSyncFiles(const KUrl::List&)));
442
+        connect(this, SIGNAL(putSyncPassiveDir(KUrl)), view, SLOT(slotPutSyncPassiveDir(const KUrl)));
443
+        connect(this, SIGNAL(drawAddToSyncFiles(const KUrl::List&)), view, SLOT(slotPutSyncFiles(const KUrl::List&)));
444
+        connect(this, SIGNAL(drawRemovedFromSyncFiles(const KUrl::List&)), view, SLOT(slotDrawRemovedFromSyncFiles(const KUrl::List&)));
445
+        connect(view, SIGNAL(putSyncFileInfo(const KUrl&, unsigned int)), this, SLOT(slotputSyncFileInfo(const KUrl&, unsigned int)));
446
+        connect(view, SIGNAL(requestSyncFiles(const KUrl&)), this, SLOT(slotGetSyncFiles(const KUrl&)));
447
+    }
448
 }
449
 
450
 void DolphinMainWindow::updateSplitAction()
451
@@ -2335,4 +2226,150 @@
452
     }
453
 }
454
 
455
+/**
456
+  Psync path
457
+*/
458
+int DolphinMainWindow::connectWithSocket()
459
+{
460
+    QString receiver_address(PSYNCD_IPC_NAME);
461
+    QFile file(receiver_address);
462
+    if (!file.exists())
463
+    {
464
+        qDebug("Psyncd not found");
465
+        return -1;
466
+    }
467
+    m_unixSocket = new UnixSocket();
468
+    if (m_unixSocket->init())
469
+    {
470
+        QDateTime time = QDateTime::currentDateTime();
471
+        m_syncSocketTime = static_cast<unsigned int>(time.toTime_t());
472
+        QString self_address(QDir::homePath() + PROGRAM_FOLDER + PROGRAM_NAME + QString::number(m_syncSocketTime));
473
+        QDir dir(QDir::homePath() + PROGRAM_FOLDER);
474
+        if (!dir.exists())
475
+            dir.mkdir(QDir::homePath() + PROGRAM_FOLDER);
476
+
477
+        if (m_unixSocket->bind(self_address.toLocal8Bit().data()))
478
+        {
479
+            m_socketNotifier = new QSocketNotifier(m_unixSocket->getSockfd(), QSocketNotifier::Read);
480
+            connect(m_socketNotifier , SIGNAL(activated(int )), this, SLOT(receiveNotification()));
481
+        }
482
+        else
483
+        {
484
+            qDebug("Error of local socket bind");
485
+            KNotification::event(KNotification::Notification,
486
+                                  i18n("Error"),
487
+                                 i18n("Synchronization service is not available"));
488
+             return -1;
489
+        }
490
+    }
491
+    else
492
+    {
493
+        qDebug("Error of local socket init");
494
+        KNotification::event(KNotification::Notification,
495
+                                  i18n("Error"),
496
+                                 i18n("Synchronization service is not available"));
497
+        return -1;
498
+    }
499
+    return 1;
500
+}
501
+
502
+void DolphinMainWindow::receiveNotification()
503
+{
504
+    IPCPacket *m_pkt = NULL;
505
+    int total_bytes = m_unixSocket->bytesAvailable();
506
+    if (m_pkt)
507
+        return;
508
+    m_pkt = new IPCPacket();
509
+    m_unixSocket->readDatagram((char*)m_pkt->readBuffer(total_bytes), total_bytes);
510
+
511
+    if( (m_pkt->IsValid()) && (m_pkt->getType() == PSYNCD_OBJECTS_LIST) && (m_pkt->getDataLen() != 0) )
512
+    {
513
+        QString res = QString::fromLocal8Bit((QByteArray((const char*)m_pkt->getData(),m_pkt->getDataLen())));
514
+        if (res.at(0) == '*')
515
+        {
516
+            res.chop(1);
517
+            KUrl url(res.right(res.size()-1));
518
+            emit putSyncPassiveDir(url);
519
+        }
520
+        else
521
+        {
522
+            QStringList all_objects = res.split("\n",QString::SkipEmptyParts);
523
+            KUrl::List urlList;
524
+            foreach (QString str, all_objects)
525
+            {
526
+                KUrl url(str);
527
+                urlList.append(url);
528
+            }
529
+            emit putSyncFiles(urlList);
530
+        }
531
+    }
532
+
533
+    if (m_pkt)
534
+        delete m_pkt;
535
+}
536
+
537
+void DolphinMainWindow::sendSyncMessage(int messageType, unsigned char* data, unsigned long dataLength)
538
+{
539
+    QString self_address(QDir::homePath() +  PROGRAM_FOLDER + PROGRAM_NAME + QString::number(m_syncSocketTime));
540
+    IPCPacket* pkt = IPCPacket::Create(messageType,self_address.toLocal8Bit().data(), data, dataLength);
541
+    QString receiver_address(PSYNCD_IPC_NAME);
542
+    if (m_unixSocket->writeDatagram((const char*)pkt->getBuffer(), pkt->getSize(), receiver_address.toLocal8Bit().data()) < 0)
543
+    {
544
+        qDebug("Error of writeDatagram");
545
+        return;
546
+    }
547
+}
548
+
549
+void DolphinMainWindow::slotGetSyncFiles(const KUrl& url)
550
+{
551
+    const int buffSize = 1024;
552
+    char buffer[buffSize];
553
+    memset(buffer, 0, buffSize);
554
+    strcpy(buffer, url.path().toLocal8Bit().data());
555
+    sendSyncMessage(PSYNCD_GET_FILES_FROM_FOLDER_COMMAND, (unsigned char*)buffer, strlen(buffer) );
556
+}
557
+
558
+void DolphinMainWindow::slotGetSyncFileInfo(const KUrl& url)
559
+{
560
+  emit getSyncFileInfo(url);
561
+}
562
+
563
+void DolphinMainWindow::slotAddFilesToSync(const KFileItemList& files)
564
+{
565
+  QString str;
566
+  KUrl::List filesList;
567
+  if (files.isEmpty())
568
+      return;
569
+  KUrl directory(files.at(0).mostLocalUrl().directory());
570
+  for(int i=0; i<files.count(); i++)
571
+  {
572
+    str.append( files.at(i).url().path() );
573
+    filesList.append(files.at(i).url());
574
+    if( i < files.count()-1 )
575
+      str.append("\n");
576
+  }
577
+  sendSyncMessage(PSYNCD_ADD_TO_SYNC_COMMAND, (unsigned char*)str.toLocal8Bit().data(), strlen(str.toLocal8Bit().data()));
578
+  slotGetSyncFiles(directory);
579
+}
580
+
581
+void DolphinMainWindow::slotRemoveFileFromSync(const KFileItemList& files)
582
+{
583
+    QString str;
584
+    KUrl::List filesList;
585
+    if (files.isEmpty())
586
+        return;
587
+     KUrl directory(files.at(0).mostLocalUrl().directory());
588
+    for(int i=0; i<files.count(); i++)
589
+    {
590
+      str.append( files.at(i).url().path() );
591
+      filesList.append(files.at(i).url());
592
+      if( i < files.count()-1 )
593
+        str.append("\n");
594
+    }
595
+    sendSyncMessage(PSYNCD_REMOVE_TO_SYNC_COMMAND, (unsigned char*)str.toLocal8Bit().data(), strlen(str.toLocal8Bit().data()));
596
+    emit drawRemovedFromSyncFiles(filesList);
597
+    slotGetSyncFiles(directory);
598
+}
599
+
600
+
601
 #include "dolphinmainwindow.moc"
602
diff -Nuar kdebase-4.6.5_old/dolphin/src/dolphinmainwindow.h kdebase-4.6.5/dolphin/src/dolphinmainwindow.h
603
--- kdebase-4.6.5_old/dolphin/src/dolphinmainwindow.h	2011-09-22 17:37:01.043275627 +0400
604
+++ kdebase-4.6.5/dolphin/src/dolphinmainwindow.h	2011-09-22 17:38:13.924275458 +0400
605
@@ -137,7 +137,7 @@
606
       void slotGetSyncFileInfo(const KUrl& url);			// Запрос у модели статуса файла (в синхронизации или нет)
607
 
608
       void slotAddFilesToSync(const KFileItemList& files);		// Добавление файла в Sync
609
-      void slotRemoveFileFromSync(const KUrl& url);			// Добавление файла в Sync
610
+      void slotRemoveFileFromSync(const KFileItemList& files);          // Удаление файла из Sync
611
       
612
     /**
613
      * Pastes the clipboard data into the currently selected folder
614
@@ -164,7 +164,7 @@
615
      /**
616
      * Передача информации о статусе синхронизации файла
617
      */    
618
-    void slotputSyncFileInfo(const KUrl& url, const bool syncState);
619
+    void slotputSyncFileInfo(const KUrl& url, unsigned int syncState);
620
 
621
 signals:
622
     /**
623
@@ -190,6 +190,9 @@
624
      * 
625
      */
626
     void putSyncFiles(const KUrl::List& files);
627
+
628
+
629
+    void putSyncPassiveDir(const KUrl);
630
     
631
     /**
632
      * Передает модели запрос на получение статуса файла (синхронизирован или нет)
633
@@ -200,7 +203,7 @@
634
      /**
635
      * Передает статуса файла (синхронизирован или нет)
636
      */    
637
-    void putSyncFileInfo(const KUrl& url, const bool syncState);
638
+    void putSyncFileInfo(const KUrl& url, unsigned int syncState);
639
     
640
      /**
641
      * Передает команду на отрисовку синхронизируемых файлов
642
@@ -501,7 +504,7 @@
643
     void initToolBar();
644
     int connectWithSyncServer();
645
     
646
-    void connectWithSocket();
647
+    int connectWithSocket();
648
     
649
     UnixSocket *m_unixSocket;
650
     QSocketNotifier *m_socketNotifier;
651
@@ -594,6 +597,8 @@
652
     DolphinViewContainer* m_activeViewContainer;
653
     QVBoxLayout* m_centralWidgetLayout;
654
     int m_id;
655
+    bool m_psyncEnabled;
656
+    int m_syncSocketTime;
657
 
658
     struct ViewTab
659
     {
660
diff -Nuar kdebase-4.6.5_old/dolphin/src/dolphinviewcontainer.cpp kdebase-4.6.5/dolphin/src/dolphinviewcontainer.cpp
661
--- kdebase-4.6.5_old/dolphin/src/dolphinviewcontainer.cpp	2011-09-22 17:36:22.836275647 +0400
662
+++ kdebase-4.6.5/dolphin/src/dolphinviewcontainer.cpp	2011-09-22 17:38:13.924275458 +0400
663
@@ -161,14 +161,7 @@
664
             this, SLOT(saveViewState()));
665
     connect(m_urlNavigator, SIGNAL(historyChanged()),
666
             this, SLOT(slotHistoryChanged()));
667
-    
668
-    connect(m_view, SIGNAL(requestSyncFiles(const KUrl&)), this, SLOT(slotRequestSyncFiles(const KUrl&)));
669
-    connect(this, SIGNAL(putSyncFiles(const KUrl::List&)), m_view, SLOT(slotPutSyncFiles(const KUrl::List&)));
670
-    connect(this, SIGNAL(getSyncFileInfo(const KUrl&)), m_view, SLOT(slotGetSyncFileInfo(const KUrl&)));
671
-    connect(m_view, SIGNAL(putSyncFileInfo(const KUrl&, const bool)), this, SLOT(slotputSyncFileInfo(const KUrl&, const bool)));
672
-    connect(this, SIGNAL(drawRemovedFromSyncFiles(const KUrl::List&)), m_view, SLOT(slotDrawRemovedFromSyncFiles(const KUrl::List&)));    
673
-    connect(this, SIGNAL(drawAddToSyncFiles(const KUrl::List&)), m_view, SLOT(slotPutSyncFiles(const KUrl::List&)));    
674
-    
675
+
676
     // initialize status bar
677
     m_statusBar = new DolphinStatusBar(this, m_view);
678
     connect(m_statusBar, SIGNAL(stopPressed()), this, SLOT(stopLoading()));
679
@@ -315,31 +308,6 @@
680
     }
681
 }
682
 
683
-void DolphinViewContainer::slotRequestSyncFiles(const KUrl& url)
684
-{
685
-  emit getSyncFiles(url);
686
-}
687
-
688
-void DolphinViewContainer::slotPutSyncFiles(const KUrl::List& files)
689
-{
690
-  emit putSyncFiles(files);
691
-}
692
-
693
-void DolphinViewContainer::slotGetSyncFileInfo(const KUrl& url)
694
-{
695
-  emit getSyncFileInfo(url);
696
-}
697
-
698
-void DolphinViewContainer::slotputSyncFileInfo(const KUrl& url, const bool syncState)
699
-{
700
-   emit putSyncFileInfo(url, syncState);
701
-}
702
-
703
-void DolphinViewContainer::slotDrawRemovedFromSyncFiles(const KUrl::List& files)
704
-{
705
-  emit drawRemovedFromSyncFiles(files);
706
-}
707
-
708
 void DolphinViewContainer::delayedStatusBarUpdate()
709
 {
710
     if (m_statusBarTimer->isActive() && (m_statusBarTimestamp.elapsed() > 2000)) {
711
diff -Nuar kdebase-4.6.5_old/dolphin/src/dolphinviewcontainer.h kdebase-4.6.5/dolphin/src/dolphinviewcontainer.h
712
--- kdebase-4.6.5_old/dolphin/src/dolphinviewcontainer.h	2011-09-22 17:36:22.837275648 +0400
713
+++ kdebase-4.6.5/dolphin/src/dolphinviewcontainer.h	2011-09-22 17:38:13.925275478 +0400
714
@@ -113,32 +113,6 @@
715
      */
716
     void setFilterBarVisible(bool visible);
717
 
718
-    /**
719
-     * Запрос у сервера списка синхронизируемых файлов
720
-     */
721
-    void slotRequestSyncFiles(const KUrl& url);
722
-
723
-    /**
724
-     * Передача серверу списка синхронизируемых файлов
725
-     */
726
-    void slotPutSyncFiles(const KUrl::List& files);
727
-    
728
-    /**
729
-     * Запрос у сервера информации о синхронизации файла
730
-     */
731
-    void slotGetSyncFileInfo(const KUrl& url);    
732
-
733
-    /**
734
-     * Передача информации о статусе синхронизации файла
735
-     */    
736
-    void slotputSyncFileInfo(const KUrl& url, const bool syncState);
737
-    
738
-     /**
739
-     * Передает команду на отрисовку удаляемых из синхронизации файлов
740
-     */    
741
-      void slotDrawRemovedFromSyncFiles(const KUrl::List& files);
742
-    
743
-
744
 signals:
745
     /**
746
      * Is emitted whenever the filter bar has changed its visibility state.
747
@@ -159,31 +133,6 @@
748
      */
749
     void searchModeChanged(bool enabled);
750
 
751
-    /**
752
-     * Запрос у сервера списка синхронизируемых файлов
753
-     */    
754
-    void getSyncFiles(const KUrl& url);
755
-
756
-    /**
757
-     * Передача от сервера списка синхронизируемых файлов
758
-     */    
759
-    void putSyncFiles(const KUrl::List& files);
760
-    
761
-    /**
762
-     * Передает модели запрос на получение статуса файла (синхронизирован или нет)
763
-     */    
764
-    void getSyncFileInfo(const KUrl& url);
765
-
766
-     /**
767
-     * Передает статуса файла (синхронизирован или нет)
768
-     */    
769
-    void putSyncFileInfo(const KUrl& url, const bool syncState);
770
-    
771
-     /**
772
-     * Передает команду на отрисовку синхронизируемых файлов
773
-     */    
774
-      void drawRemovedFromSyncFiles(const KUrl::List& files);
775
-
776
 private slots:
777
     /**
778
      * Updates the number of items (= number of files + number of
779
diff -Nuar kdebase-4.6.5_old/dolphin/src/ipc/ipc_interface.h kdebase-4.6.5/dolphin/src/ipc/ipc_interface.h
780
--- kdebase-4.6.5_old/dolphin/src/ipc/ipc_interface.h	2011-09-22 17:36:22.837275648 +0400
781
+++ kdebase-4.6.5/dolphin/src/ipc/ipc_interface.h	1970-01-01 03:00:00.000000000 +0300
782
@@ -1,15 +0,0 @@
783
-#ifndef IPC_INTERFACE_H
784
-#define IPC_INTERFACE_H
785
-
786
-//Адрес для локального сокета, использующегося программой
787
-#define PROGRAM_CATALOG			"/.psyncclient/"
788
-#define SYNCRONIZE_PROGRAM_NAME		"psyncd"
789
-#define PROGRAM_NAME			"dolphin"
790
-
791
-//Типы сообщений
792
-#define ADD_TO_SYNC_COMMAND		10
793
-#define REMOVE_TO_SYNC_COMMAND		11
794
-#define GET_FILES_FROM_FOLDER_COMMAND	12
795
-#define PUT_SYNC_FILES			13
796
-
797
-#endif // IPC_INTERFACE_H
798
diff -Nuar kdebase-4.6.5_old/dolphin/src/ipc/ipcpacket.h kdebase-4.6.5/dolphin/src/ipc/ipcpacket.h
799
--- kdebase-4.6.5_old/dolphin/src/ipc/ipcpacket.h	2011-09-22 17:36:22.838275649 +0400
800
+++ kdebase-4.6.5/dolphin/src/ipc/ipcpacket.h	1970-01-01 03:00:00.000000000 +0300
801
@@ -1,48 +0,0 @@
802
-#ifndef IPCPACKET_H
803
-#define IPCPACKET_H
804
-
805
-#include <string.h>
806
-#include <stdio.h>
807
-#include "psyncipclibrary_global.h"
808
-
809
-class PSYNCIPCLIBRARYSHARED_EXPORT IPCPacket
810
-{
811
-public:
812
-    IPCPacket();
813
-    ~IPCPacket();
814
-
815
-    void readResult(unsigned long);
816
-    unsigned char* readBuffer();
817
-    unsigned long readNeeded();
818
-
819
-    unsigned char* readBuffer(unsigned long datagramm_size);
820
-    bool IsValid();
821
-
822
-    static IPCPacket* Create(unsigned long, char*, unsigned char*, unsigned long);
823
-    unsigned char* getBuffer();
824
-    unsigned long getSize();
825
-    unsigned long getType();
826
-    char* getSender();
827
-    unsigned char* getData();
828
-    unsigned long getDataLen();
829
-
830
-private:
831
-    enum buffer_offset
832
-    {
833
-        SIZE_FIELD_SERVICE_BYTE = 1,
834
-        SIZE_FIELD_LENGTH = sizeof(unsigned long),
835
-        SIZE_FIELD_TYPE = sizeof(unsigned long),
836
-        OFFSET_FIELD_LENGTH = SIZE_FIELD_SERVICE_BYTE,
837
-        OFFSET_FIELD_TYPE = OFFSET_FIELD_LENGTH + SIZE_FIELD_LENGTH,
838
-        SENDER_OFFSET = OFFSET_FIELD_TYPE + SIZE_FIELD_TYPE
839
-    };
840
-private:
841
-    unsigned char* m_buffer;
842
-    unsigned long m_size;
843
-    unsigned char *m_size_buf;
844
-    unsigned long m_needed;
845
-private:
846
-    static const int SERVICE_BYTE = 0x7E;
847
-};
848
-
849
-#endif // IPCPACKET_H
850
diff -Nuar kdebase-4.6.5_old/dolphin/src/ipc/psyncipclibrary_global.h kdebase-4.6.5/dolphin/src/ipc/psyncipclibrary_global.h
851
--- kdebase-4.6.5_old/dolphin/src/ipc/psyncipclibrary_global.h	2011-09-22 17:36:22.838275649 +0400
852
+++ kdebase-4.6.5/dolphin/src/ipc/psyncipclibrary_global.h	1970-01-01 03:00:00.000000000 +0300
853
@@ -1,12 +0,0 @@
854
-#ifndef PSYNCIPCLIBRARY_GLOBAL_H
855
-#define PSYNCIPCLIBRARY_GLOBAL_H
856
-
857
-#include <QtCore/qglobal.h>
858
-
859
-#if defined(PSYNCIPCLIBRARY_LIBRARY)
860
-#  define PSYNCIPCLIBRARYSHARED_EXPORT Q_DECL_EXPORT
861
-#else
862
-#  define PSYNCIPCLIBRARYSHARED_EXPORT Q_DECL_IMPORT
863
-#endif
864
-
865
-#endif // PSYNCIPCLIBRARY_GLOBAL_H
866
diff -Nuar kdebase-4.6.5_old/dolphin/src/ipc/unixsocket.h kdebase-4.6.5/dolphin/src/ipc/unixsocket.h
867
--- kdebase-4.6.5_old/dolphin/src/ipc/unixsocket.h	2011-09-22 17:36:22.838275649 +0400
868
+++ kdebase-4.6.5/dolphin/src/ipc/unixsocket.h	1970-01-01 03:00:00.000000000 +0300
869
@@ -1,31 +0,0 @@
870
-#ifndef UNIXSOCKET_H
871
-#define UNIXSOCKET_H
872
-
873
-#include <sys/types.h>
874
-#include <sys/socket.h>
875
-#include <sys/un.h>
876
-#include <unistd.h>
877
-#include <stdio.h>
878
-#include <sys/ioctl.h>
879
-#include "psyncipclibrary_global.h"
880
-
881
-class PSYNCIPCLIBRARYSHARED_EXPORT UnixSocket
882
-{    
883
-public:
884
-    UnixSocket();
885
-
886
-    bool init();
887
-    bool bind(const char *addr_str);
888
-    int readDatagram(char *buf, int len);
889
-    int writeDatagram(const char* buf, int len, const char *clnt_addr_str);
890
-    void finish();
891
-    int getSockfd();
892
-    int bytesAvailable();
893
-
894
-private:
895
-    struct sockaddr_un m_serv_addr;
896
-    int m_saddrlen;
897
-    int sockfd;
898
-};
899
-
900
-#endif // UNIXSOCKET_H
901
diff -Nuar kdebase-4.6.5_old/dolphin/src/views/dolphinfileitemdelegate.cpp kdebase-4.6.5/dolphin/src/views/dolphinfileitemdelegate.cpp
902
--- kdebase-4.6.5_old/dolphin/src/views/dolphinfileitemdelegate.cpp	2011-09-22 17:36:22.839275649 +0400
903
+++ kdebase-4.6.5/dolphin/src/views/dolphinfileitemdelegate.cpp	2011-09-22 17:38:13.926275495 +0400
904
@@ -32,6 +32,7 @@
905
 #include <QFontMetrics>
906
 #include <QPalette>
907
 #include <QPainter>
908
+#include <QDebug>
909
 #include <QStyleOptionViewItemV4>
910
 
911
 #include "icons.h"
912
@@ -99,19 +100,28 @@
913
     
914
 // @@@
915
 
916
-const DolphinModel* dModel = static_cast<const DolphinModel*>(index.model());
917
-
918
-    if( (dModel->data(index, DolphinModel::SyncRole)).toBool() ) {
919
+    const DolphinModel* dModel = static_cast<const DolphinModel*>(index.model());
920
+    int sync = dModel->data(index, DolphinModel::SyncRole).toInt();
921
+    QPixmap pm;
922
+    switch (sync)
923
+    {
924
+    case 1: pm.load(":/green_icon.png");
925
+        break;
926
+    case 2: pm.load(":/gray_icon.png");
927
+        break;
928
+    }
929
+    if (!pm.isNull())
930
+    {
931
+       // qDebug("Paint check");
932
       KFileItemDelegate::paint(painter, opt, index);
933
-
934
       const QRect rect = iconRect(option, index);
935
-      const QPixmap *pm = new QPixmap((const char **) sync_icon);
936
-      QPixmap pmm = pm->scaled(rect.width()/4, rect.height()/4);
937
-      QSize s = pmm.size();
938
-      painter->drawPixmap(rect.x(), rect.y() + rect.height() - pmm.height(), pmm);
939
+      if ((rect.width()/4 < pm.width()) || (rect.height()/4 < pm.height()))
940
+        pm = pm.scaled(rect.width()/4, rect.height()/4, Qt::KeepAspectRatio, Qt::SmoothTransformation);
941
+      painter->setRenderHint(QPainter::HighQualityAntialiasing);
942
+      painter->drawPixmap(rect.x(), rect.y() + rect.height() - pm.height(), pm);
943
 
944
       flag = false;
945
-    } 
946
+    }
947
 
948
     if( flag ) {
949
         KFileItemDelegate::paint(painter, opt, index);
950
diff -Nuar kdebase-4.6.5_old/dolphin/src/views/dolphinmodel.cpp kdebase-4.6.5/dolphin/src/views/dolphinmodel.cpp
951
--- kdebase-4.6.5_old/dolphin/src/views/dolphinmodel.cpp	2011-09-22 17:36:22.839275649 +0400
952
+++ kdebase-4.6.5/dolphin/src/views/dolphinmodel.cpp	2011-09-22 17:38:13.926275495 +0400
953
@@ -40,6 +40,8 @@
954
 #include <QPersistentModelIndex>
955
 #include <QDir>
956
 #include <QFileInfo>
957
+#include <QDebug>
958
+#include <QString>
959
 
960
 const char* const DolphinModel::m_others = I18N_NOOP2("@title:group Name", "Others");
961
 
962
@@ -75,19 +77,24 @@
963
         }
964
     }
965
     
966
-    if(role == DolphinModel::SyncRole) {
967
-      const KDirModel *dirModel = qobject_cast<const KDirModel*>(index.model());
968
-      const KFileItem item = dirModel->itemForIndex(index);
969
-      
970
-      if( value.toBool() )
971
-	syncFiles.append(item.url());
972
-      else
973
-      if( syncFiles.contains(item.url()) )
974
-	syncFiles.removeAt(syncFiles.indexOf(item.url()));
975
-	
976
-
977
-    emit dataChanged(index, index);
978
-      return true;
979
+    if(role == DolphinModel::SyncRole)
980
+    {
981
+        const KDirModel *dirModel = qobject_cast<const KDirModel*>(index.model());
982
+        const KFileItem item = dirModel->itemForIndex(index);
983
+        struct SyncFile sf;
984
+        sf.url = item.url();
985
+        sf.type = value.toInt();
986
+        if( value.toInt() )
987
+        {
988
+            syncFiles.insert(item.localPath(),sf);
989
+        }
990
+        else
991
+        {
992
+            if (syncFiles.contains(item.localPath()));
993
+                syncFiles.remove(item.localPath());
994
+        }
995
+        emit dataChanged(index, index);
996
+        return true;
997
     }
998
 
999
     return KDirModel::setData(index, (const QVariant)value, role);
1000
@@ -103,16 +110,18 @@
1001
     switch (role) {
1002
       
1003
     case DolphinModel::SyncRole: {
1004
-
1005
       if(index.isValid())
1006
       {
1007
 	  const KDirModel *dirModel = qobject_cast<const KDirModel*>(index.model());
1008
           const KFileItem item = dirModel->itemForIndex(index);
1009
-	  bool b = syncFiles.contains(item.url());
1010
-	  return b;
1011
+          if (syncFiles.contains(item.localPath()))
1012
+            return syncFiles[item.localPath()].type;
1013
+          return 0;
1014
       }
1015
       else
1016
-	  return false;
1017
+      {
1018
+          return 0;
1019
+      }
1020
     }
1021
       
1022
     case KCategorizedSortFilterProxyModel::CategoryDisplayRole:
1023
diff -Nuar kdebase-4.6.5_old/dolphin/src/views/dolphinmodel.h kdebase-4.6.5/dolphin/src/views/dolphinmodel.h
1024
--- kdebase-4.6.5_old/dolphin/src/views/dolphinmodel.h	2011-09-22 17:36:22.840275649 +0400
1025
+++ kdebase-4.6.5/dolphin/src/views/dolphinmodel.h	2011-09-22 17:38:13.926275495 +0400
1026
@@ -28,6 +28,12 @@
1027
 #include <QHash>
1028
 #include <QPersistentModelIndex>
1029
 
1030
+struct SyncFile
1031
+{
1032
+    KUrl url;
1033
+    int type;
1034
+};
1035
+
1036
 class LIBDOLPHINPRIVATE_EXPORT DolphinModel : public KDirModel
1037
 {
1038
     Q_OBJECT
1039
@@ -64,8 +70,8 @@
1040
 private:
1041
     QVariant displayRoleData(const QModelIndex& index) const;
1042
     QVariant sortRoleData(const QModelIndex& index) const;
1043
-    
1044
-    KUrl::List syncFiles;
1045
+    QHash<QString,SyncFile> syncFiles;
1046
+    //KUrl::List syncFiles;
1047
 
1048
 private:
1049
     bool m_hasVersionData;
1050
diff -Nuar kdebase-4.6.5_old/dolphin/src/views/dolphinviewactionhandler.cpp kdebase-4.6.5/dolphin/src/views/dolphinviewactionhandler.cpp
1051
--- kdebase-4.6.5_old/dolphin/src/views/dolphinviewactionhandler.cpp	2011-09-22 17:36:22.840275649 +0400
1052
+++ kdebase-4.6.5/dolphin/src/views/dolphinviewactionhandler.cpp	2011-09-22 17:38:13.927275508 +0400
1053
@@ -38,8 +38,10 @@
1054
 #include <krun.h>
1055
 #include <kpropertiesdialog.h>
1056
 #include <kurl.h>
1057
+#include <kfileitem.h>
1058
 
1059
 #include <qdir.h>
1060
+#include <qlist.h>
1061
 
1062
 #include <unistd.h>
1063
 
1064
@@ -593,20 +595,24 @@
1065
 
1066
 void DolphinViewActionHandler::slotAddToSync()
1067
 {
1068
-
1069
-    const KFileItemList list = m_currentView->selectedItems();
1070
-        
1071
-    if (!list.isEmpty()) {
1072
-    emit addFilesToSync(list);
1073
+    if (!m_currentView->isDirectorySyncked())
1074
+    {
1075
+        KFileItemList list = m_currentView->selectedItems();
1076
+        if (!list.isEmpty())
1077
+        {
1078
+            emit addFilesToSync(list);
1079
+        }
1080
     }
1081
 }
1082
 
1083
 void DolphinViewActionHandler::slotRemoveFromSync()
1084
 {
1085
-    const KFileItemList list = m_currentView->selectedItems();  
1086
-    
1087
-   if (!list.isEmpty()) {
1088
-// Remove from sync
1089
-    emit removeFileFromSync(list.at(0).url());
1090
+    if (!m_currentView->isDirectorySyncked())
1091
+    {
1092
+        KFileItemList list = m_currentView->selectedItems();
1093
+        if (!list.isEmpty())
1094
+        {
1095
+           emit removeFileFromSync(list);
1096
+        }
1097
     }
1098
-}
1099
\ В конце файла нет новой строки
1100
+ }
1101
diff -Nuar kdebase-4.6.5_old/dolphin/src/views/dolphinviewactionhandler.h kdebase-4.6.5/dolphin/src/views/dolphinviewactionhandler.h
1102
--- kdebase-4.6.5_old/dolphin/src/views/dolphinviewactionhandler.h	2011-09-22 17:36:22.841275649 +0400
1103
+++ kdebase-4.6.5/dolphin/src/views/dolphinviewactionhandler.h	2011-09-22 17:38:13.927275508 +0400
1104
@@ -78,7 +78,7 @@
1105
 
1106
 signals:
1107
     void addFilesToSync(const KFileItemList& files);
1108
-    void removeFileFromSync(const KUrl& url);
1109
+    void removeFileFromSync(const KFileItemList& files);
1110
     
1111
 public Q_SLOTS:
1112
     /**
1113
diff -Nuar kdebase-4.6.5_old/dolphin/src/views/dolphinview.cpp kdebase-4.6.5/dolphin/src/views/dolphinview.cpp
1114
--- kdebase-4.6.5_old/dolphin/src/views/dolphinview.cpp	2011-09-22 17:36:22.841275649 +0400
1115
+++ kdebase-4.6.5/dolphin/src/views/dolphinview.cpp	2011-09-22 17:38:13.928275517 +0400
1116
@@ -28,6 +28,7 @@
1117
 #include <QBoxLayout>
1118
 #include <QTimer>
1119
 #include <QScrollBar>
1120
+#include <QDebug>
1121
 
1122
 #include <kactioncollection.h>
1123
 #include <kcolorscheme.h>
1124
@@ -90,7 +91,8 @@
1125
     m_restoredContentsPosition(),
1126
     m_createdItemUrl(),
1127
     m_selectedItems(),
1128
-    m_newFileNames()
1129
+    m_newFileNames(),
1130
+    m_isFolderSyncked(false)
1131
 {
1132
     m_topLayout = new QVBoxLayout(this);
1133
     m_topLayout->setSpacing(0);
1134
@@ -128,7 +130,8 @@
1135
             this, SLOT(clearHoverInformation()));
1136
     connect(m_dolphinViewController, SIGNAL(urlChangeRequested(KUrl)),
1137
             this, SLOT(slotUrlChangeRequested(KUrl)));
1138
-
1139
+    connect(m_viewAccessor.dirLister(),SIGNAL(completed()),
1140
+            this,SLOT(processSyncUrls()));
1141
     // When a new item has been created by the "Create New..." menu, the item should
1142
     // get selected and it must be assured that the item will get visible. As the
1143
     // creation is done asynchronously, several signals must be checked:
1144
@@ -412,6 +415,8 @@
1145
     saveState(saveStream);
1146
     m_selectedItems= selectedItems();
1147
 
1148
+    m_syncUrlsList.clear();// psync path
1149
+    m_isFolderSyncked = false;
1150
     setUrl(url());
1151
     loadDirectory(url(), true);
1152
 
1153
@@ -546,7 +551,6 @@
1154
     if (hadSelection || hasSelection()) {
1155
         emitSelectionChangedSignal();
1156
     }
1157
-    emit requestSyncFiles(url);
1158
 }
1159
 
1160
 void DolphinView::selectAll()
1161
@@ -688,42 +692,6 @@
1162
     emit showHiddenFilesChanged();
1163
 }
1164
 
1165
-void DolphinView::slotPutSyncFiles(const KUrl::List& files)
1166
-{
1167
-  DolphinModel* dolphinModel = m_viewAccessor.dirModel();
1168
-
1169
-  for(int i=0; i<files.count(); i++)
1170
-  {
1171
-//    qDebug("KUrl = %s", files.at(i).path().toLocal8Bit().data());
1172
-    const KUrl url = files.at(i);
1173
-    const QModelIndex index = dolphinModel->indexForUrl(url);
1174
-//    const QModelIndex index = dolphinModel->indexForUrl(files.at(i));
1175
-
1176
-   if(index.isValid())
1177
-      dolphinModel->setData(index, true, DolphinModel::SyncRole);
1178
-  }
1179
-}
1180
-
1181
-void DolphinView::slotGetSyncFileInfo(const KUrl& url)
1182
-{
1183
-   DolphinModel* dolphinModel = m_viewAccessor.dirModel();
1184
-   QModelIndex index = dolphinModel->indexForUrl(url);
1185
-   
1186
-   emit putSyncFileInfo(url, dolphinModel->data(index, DolphinModel::SyncRole).toBool());
1187
-}
1188
-
1189
-void DolphinView::slotDrawRemovedFromSyncFiles(const KUrl::List& files)
1190
-{
1191
-  DolphinModel* dolphinModel = m_viewAccessor.dirModel();
1192
-    
1193
-  for(int i=0; i<files.count(); i++)
1194
-  {
1195
-    const QModelIndex index = dolphinModel->indexForUrl(files.at(i));
1196
-
1197
-    if(index.isValid())
1198
-      dolphinModel->setData(index, false, DolphinModel::SyncRole);
1199
-  }
1200
-}
1201
 
1202
 void DolphinView::setCategorizedSorting(bool categorized)
1203
 {
1204
@@ -1180,15 +1148,16 @@
1205
 
1206
     KDirLister* dirLister = m_viewAccessor.dirLister();
1207
     dirLister->openUrl(url, reload ? KDirLister::Reload : KDirLister::NoFlags);
1208
-    
1209
+    m_isFolderSyncked = false;
1210
+    m_syncUrlsList.clear();
1211
     DolphinModel* dolphinModel = m_viewAccessor.dirModel();
1212
     dolphinModel->clearSyncFiles();
1213
+    emit requestSyncFiles(url);
1214
 }
1215
 
1216
 void DolphinView::applyViewProperties()
1217
 {
1218
     const ViewProperties props(rootUrl());
1219
-
1220
     const Mode mode = props.viewMode();
1221
     if (m_mode != mode) {
1222
         const int oldZoomLevel = m_viewModeController->zoomLevel();
1223
@@ -1198,6 +1167,7 @@
1224
         emit modeChanged();
1225
 
1226
         updateZoomLevel(oldZoomLevel);
1227
+        processSyncUrls(); //psync path
1228
     }
1229
     if (m_viewAccessor.itemView() == 0) {
1230
         createView();
1231
@@ -1628,4 +1598,94 @@
1232
     return dirModel()->dirLister();
1233
 }
1234
 
1235
+/**
1236
+  Psync path
1237
+*/
1238
+
1239
+void DolphinView::slotPutSyncFiles(const KUrl::List& files)
1240
+{
1241
+    m_isFolderSyncked = false;
1242
+    KDirLister* lister = m_viewAccessor.dirLister();
1243
+    m_syncUrlsList.clear();
1244
+    foreach(KUrl url, files)
1245
+    {
1246
+        m_syncUrlsList.append(url);
1247
+    }
1248
+    if (lister->isFinished())
1249
+    {
1250
+        processSyncUrls();
1251
+    }
1252
+}
1253
+
1254
+void DolphinView::slotPutSyncPassiveDir(const KUrl url)
1255
+{
1256
+    KDirLister* lister = m_viewAccessor.dirLister();
1257
+    if (lister->url().path() != url.path())
1258
+        return;
1259
+    m_isFolderSyncked = true;
1260
+    if (lister->isFinished())
1261
+    {
1262
+        processSyncUrls();
1263
+    }
1264
+}
1265
+
1266
+void DolphinView::processSyncUrls()
1267
+{
1268
+    DolphinModel* dolphinModel = m_viewAccessor.dirModel();
1269
+    KDirLister* lister = m_viewAccessor.dirLister();
1270
+    if(m_isFolderSyncked)
1271
+    {
1272
+        KFileItemList list = lister->items();
1273
+        foreach(KFileItem item, list)
1274
+        {
1275
+            const QModelIndex index = dolphinModel->indexForUrl(item.url());
1276
+            if(index.isValid())
1277
+            {
1278
+                dolphinModel->setData(index, 2, DolphinModel::SyncRole);
1279
+            }
1280
+        }
1281
+    }
1282
+    else
1283
+    {
1284
+        for(int i=0; i<m_syncUrlsList.count(); i++)
1285
+        {
1286
+            const KUrl url = m_syncUrlsList.at(i);
1287
+            const QModelIndex index = dolphinModel->indexForUrl(url);
1288
+            if(index.isValid())
1289
+            {
1290
+                dolphinModel->setData(index, 1, DolphinModel::SyncRole);
1291
+            }
1292
+        }
1293
+    }
1294
+}
1295
+
1296
+void DolphinView::slotGetSyncFileInfo(const KUrl& url)
1297
+{
1298
+   DolphinModel* dolphinModel = m_viewAccessor.dirModel();
1299
+   QModelIndex index = dolphinModel->indexForUrl(url);
1300
+
1301
+   emit putSyncFileInfo(url, dolphinModel->data(index, DolphinModel::SyncRole).toInt());
1302
+}
1303
+
1304
+void DolphinView::slotDrawRemovedFromSyncFiles(const KUrl::List& files)
1305
+{
1306
+
1307
+  DolphinModel* dolphinModel = m_viewAccessor.dirModel();
1308
+
1309
+  for(int i=0; i<files.count(); i++)
1310
+  {
1311
+    const QModelIndex index = dolphinModel->indexForUrl(files.at(i));
1312
+
1313
+    if(index.isValid())
1314
+     {
1315
+        dolphinModel->setData(index, 0, DolphinModel::SyncRole);
1316
+     }
1317
+  }
1318
+}
1319
+
1320
+bool DolphinView::isDirectorySyncked()
1321
+{
1322
+    return m_isFolderSyncked;
1323
+}
1324
+
1325
 #include "dolphinview.moc"
1326
diff -Nuar kdebase-4.6.5_old/dolphin/src/views/dolphinview.h kdebase-4.6.5/dolphin/src/views/dolphinview.h
1327
--- kdebase-4.6.5_old/dolphin/src/views/dolphinview.h	2011-09-22 17:36:22.842275649 +0400
1328
+++ kdebase-4.6.5/dolphin/src/views/dolphinview.h	2011-09-22 17:38:13.929275535 +0400
1329
@@ -337,6 +337,9 @@
1330
     /** Returns true, if at least one item is selected. */
1331
     bool hasSelection() const;
1332
 
1333
+    /** Returns true, if directory sincked by psyncd. */
1334
+    bool isDirectorySyncked();
1335
+
1336
 public slots:
1337
     /**
1338
      * Changes the directory to \a url. If the current directory is equal to
1339
@@ -422,9 +425,17 @@
1340
      * categorized sorting setting will be stored automatically.
1341
      */
1342
     void setCategorizedSorting(bool categorized);
1343
-    
1344
+    /**
1345
+     *  Dolphin sync patch
1346
+     */
1347
     void slotPutSyncFiles(const KUrl::List& files);
1348
 
1349
+    void slotPutSyncPassiveDir(const KUrl);
1350
+    /**
1351
+     *  Dolphin sync patch
1352
+     */
1353
+    void processSyncUrls();
1354
+
1355
     /**
1356
      * Передача серверу списка синхронизируемых файлов
1357
      */
1358
@@ -561,7 +572,7 @@
1359
      */    
1360
     void getSyncFileInfo(const KUrl& url);
1361
     
1362
-    void putSyncFileInfo(const KUrl& url, const bool syncState);
1363
+    void putSyncFileInfo(const KUrl& url, unsigned int syncState);
1364
     
1365
 protected:
1366
     /** @see QWidget::mouseReleaseEvent */
1367
@@ -845,6 +856,8 @@
1368
     bool m_assureVisibleCurrentIndex : 1;
1369
     bool m_expanderActive : 1;
1370
     bool m_isFolderWritable : 1;
1371
+    bool m_isFolderSyncked;
1372
+    KUrl::List m_syncUrlsList;
1373
 
1374
     Mode m_mode;
1375
 
1376
diff -Nuar kdebase-4.6.5_old/dolphin/src/views/icons.h kdebase-4.6.5/dolphin/src/views/icons.h
1377
--- kdebase-4.6.5_old/dolphin/src/views/icons.h	2011-09-22 17:36:22.844275649 +0400
1378
+++ kdebase-4.6.5/dolphin/src/views/icons.h	2011-09-22 17:38:13.930275552 +0400
1379
@@ -1,156 +1,217 @@
1380
-/* XPM */
1381
-static const char * const sync_icon[]={
1382
-"24 24 129 2",
1383
-"Qt c None",
1384
-"#Z c #000000",
1385
-"#3 c #04b908",
1386
-"#T c #09ba0a",
1387
-"#O c #0ebc08",
1388
-"#4 c #0ec211",
1389
-"#6 c #10c514",
1390
-"#J c #12bb09",
1391
-"#D c #13bb07",
1392
-"#2 c #13bd17",
1393
-"#5 c #18cd1c",
1394
-"#U c #19c919",
1395
-"#X c #1bb51b",
1396
-"#W c #1bbd1d",
1397
-"#r c #1db506",
1398
-"#Y c #1dcf1f",
1399
-"#V c #1ec41e",
1400
-"#w c #1fb40e",
1401
-"#Q c #1fb51a",
1402
-"#P c #21c21c",
1403
-"#L c #22b61a",
1404
-"#K c #23bb1b",
1405
-"#h c #24ac08",
1406
-"#B c #24c012",
1407
-"#A c #26b714",
1408
-"#F c #26b71a",
1409
-"#E c #26b91a",
1410
-"#M c #26cc1d",
1411
-"#G c #29d71e",
1412
-"#x c #2ab919",
1413
-"#0 c #2bc42b",
1414
-"#z c #2ccd1c",
1415
-"#o c #2eba19",
1416
-"#l c #30b511",
1417
-"#u c #32cf1c",
1418
-".8 c #33b30b",
1419
-"#s c #34d01c",
1420
-".2 c #35b106",
1421
-"#i c #35bb19",
1422
-"#t c #35d91d",
1423
-"#y c #35da23",
1424
-"#f c #37b813",
1425
-"#N c #38c832",
1426
-".V c #3ab302",
1427
-"#j c #3acd1a",
1428
-".5 c #3cb90d",
1429
-"#b c #3cba12",
1430
-"#d c #3cbf18",
1431
-"#k c #3dd41b",
1432
-"#p c #3ddb1d",
1433
-".Q c #41b708",
1434
-".9 c #42c017",
1435
-"#S c #43cb45",
1436
-".I c #44ba02",
1437
-"#e c #44de1c",
1438
-"#a c #45d21a",
1439
-"#c c #46ba23",
1440
-".3 c #46c117",
1441
-".O c #47be08",
1442
-"#m c #47c831",
1443
-"#. c #48c21e",
1444
-".0 c #4bc316",
1445
-".Z c #4bc516",
1446
-".4 c #4bd019",
1447
-".y c #4cbf01",
1448
-".Y c #4cc617",
1449
-"#9 c #4ccd51",
1450
-"## c #4cdd1a",
1451
-".E c #4fbf0d",
1452
-".F c #4fc30b",
1453
-".S c #4fc416",
1454
-".x c #50c201",
1455
-".R c #50c717",
1456
-".U c #50c817",
1457
-".s c #52c304",
1458
-".m c #53c400",
1459
-".N c #53c516",
1460
-".M c #53c616",
1461
-".L c #55ca17",
1462
-".i c #56c600",
1463
-".H c #57c615",
1464
-".t c #57c70a",
1465
-".q c #58c706",
1466
-".G c #58ca16",
1467
-".z c #58cb11",
1468
-"#I c #59d153",
1469
-".j c #5ac904",
1470
-".C c #5bc815",
1471
-".B c #5cca16",
1472
-".A c #5dce16",
1473
-".w c #5ecf10",
1474
-".v c #60cc16",
1475
-".h c #61cb11",
1476
-".u c #61d116",
1477
-".n c #64d312",
1478
-".o c #65d315",
1479
-".P c #67c635",
1480
-".6 c #67c848",
1481
-".p c #67d515",
1482
-"#7 c #6fd771",
1483
-".7 c #71cc53",
1484
-"#g c #73d55e",
1485
-"#1 c #89de8b",
1486
-".K c #8bd569",
1487
-"#H c #8ee087",
1488
-".1 c #96d879",
1489
-".k c #96dc62",
1490
-"#8 c #9ae39c",
1491
-"#n c #9be38d",
1492
-".d c #9de066",
1493
-".c c #a4e272",
1494
-"#v c #a5e69b",
1495
-".D c #a6df81",
1496
-".r c #b4e690",
1497
-".X c #baeaae",
1498
-".b c #beeb99",
1499
-".e c #cceeb3",
1500
-"#q c #cff2ca",
1501
-".J c #d3efc3",
1502
-".a c #d3f1ba",
1503
-".W c #d4f0c6",
1504
-"#R c #ddf5dc",
1505
-"a. c #e1f7e2",
1506
-".l c #ebf8e3",
1507
-"#C c #eefaee",
1508
-".f c #f3fbed",
1509
-".g c #f3fcf2",
1510
-".# c #fafef9",
1511
-".T c #ffffff",
1512
-"QtQtQtQtQtQtQtQt.#.a.b.c.d.b.e.fQtQtQtQtQtQtQtQt",
1513
-"QtQtQtQtQtQt.g.c.h.i.i.j.j.i.i.j.k.lQtQtQtQtQtQt",
1514
-"QtQtQtQtQt.e.h.m.n.o.o.o.o.o.p.p.i.q.rQtQtQtQtQt",
1515
-"QtQtQtQt.r.s.t.u.v.v.v.v.v.v.v.u.u.w.x.kQtQtQtQt",
1516
-"QtQtQt.e.y.z.A.B.B.C.C.C.C.C.C.B.B.A.u.y.DQtQtQt",
1517
-"QtQt.l.E.F.G.G.H.H.H.H.H.H.H.H.H.G.G.A.z.I.JQtQt",
1518
-"QtQt.K.I.L.L.M.N.N.N.N.N.N.N.N.N.M.M.L.L.O.PQtQt",
1519
-"Qt.f.Q.R.R.S.S.S.S.S.S.S.S.S.S.S.T.T.R.R.U.V.WQt",
1520
-"Qt.X.V.Y.Z.0.0.0.0.0.0.0.0.0.0.T.T.T.T.Y.Y.V.1Qt",
1521
-"Qt.K.2.3.3.3.3.3.3.3.3.3.3.3.T.T.T.T.T.4.3.5.6Qt",
1522
-"Qt.7.8.9.9.9.9.T.T#..9.9.9.T.T.T.T.T###a.9#b#cQt",
1523
-"Qt.6.8#d#d#d.T.T.T.T#d#d.T.T.T.T.T#e#a#d#d#f#cQt",
1524
-"Qt#g#h#d#i#j.T.T.T.T.T.T.T.T.T.T#e#k#d#i#i#l#mQt",
1525
-"Qt#n#h#o#i#j#k.T.T.T.T.T.T.T.T#p#j#i#i#i#i#h#gQt",
1526
-"Qt#q#r#o#o#o#s#t.T.T.T.T.T.T#t#u#o#o#o#o#o#r#vQt",
1527
-"QtQt#m#w#x#x#x#u#t.T.T.T.T#y#z#o#x#x#x#x#A#B#CQt",
1528
-"QtQt.X#D#E#F#F#E#z#G.T.T#y#z#E#E#E#F#F#E#D#HQtQt",
1529
-"QtQtQt#I#J#K#L#L#L#M#G#G#M#L#L#L#L#L#K#J#N.gQtQt",
1530
-"QtQtQt.g#N#O#P#Q#Q#Q#Q#Q#Q#Q#Q#Q#Q#P#O#P#RQtQtQt",
1531
-"QtQtQtQt#C#S#T#U#V#W#X#X#X#X#W#P#Y#Z#0#RQtQtQtQt",
1532
-"QtQtQtQtQt.##1#2#3#4#5#Y#Y#5#6#3#T#7#CQtQtQtQtQt",
1533
-"QtQtQtQtQtQtQt#C#8#9#W#3#3#2#S#1a.QtQtQtQtQtQtQt",
1534
-"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt",
1535
-"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt"};
1536
+/****************************************************************************
1537
+** Resource object code
1538
+**
1539
+** Created: Fri Aug 26 16:16:32 2011
1540
+**      by: The Resource Compiler for Qt version 4.7.3
1541
+**
1542
+** WARNING! All changes made in this file will be lost!
1543
+*****************************************************************************/
1544
+
1545
+#include <QtCore/qglobal.h>
1546
+
1547
+static const unsigned char qt_resource_data[] = {
1548
+  // /home/user/work/kdebase4/build/kdebase-4.6.5/dolphin/src/views/green_icon.png
1549
+  0x0,0x0,0x4,0x5b,
1550
+  0x89,
1551
+  0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
1552
+  0x0,0x0,0x18,0x0,0x0,0x0,0x18,0x8,0x6,0x0,0x0,0x0,0xe0,0x77,0x3d,0xf8,
1553
+  0x0,0x0,0x4,0x22,0x49,0x44,0x41,0x54,0x48,0x89,0xb5,0x95,0x5f,0x88,0x54,0x55,
1554
+  0x1c,0xc7,0x3f,0xbf,0x73,0x67,0x66,0x67,0x66,0xd7,0x5d,0xd7,0x5d,0xb3,0xa2,0x56,
1555
+  0x33,0x23,0x42,0x30,0x5,0x25,0x5d,0x29,0x12,0x22,0x2d,0x50,0x88,0x1e,0xac,0xe8,
1556
+  0x21,0xb2,0x7a,0xec,0xcd,0x87,0xa2,0x28,0x82,0x9e,0x2a,0xc2,0xc4,0xe8,0xb5,0x7,
1557
+  0x85,0x32,0x48,0xb2,0x22,0xb,0xa2,0xc2,0x22,0x12,0x25,0x7c,0x30,0x25,0x73,0x5b,
1558
+  0x43,0x77,0x75,0x77,0x5d,0x67,0x77,0xe7,0xde,0x3b,0xf7,0xfc,0xf9,0xf5,0x70,0x67,
1559
+  0xc7,0xdd,0x76,0x57,0x7d,0xe9,0x7,0x7,0x86,0x3,0xf3,0xf9,0x7e,0xbf,0xbf,0xdf,
1560
+  0xb9,0xe7,0x88,0xaa,0x22,0x22,0x2c,0x54,0x2f,0x9c,0x35,0x25,0x11,0x1e,0x2,0x56,
1561
+  0x2,0xab,0x81,0x32,0x70,0x1c,0x18,0xd6,0xc0,0x51,0xd,0x5c,0x9,0x1,0x4a,0xed,
1562
+  0xf9,0xa,0xe,0xf6,0x2d,0xb,0x0,0xa8,0x2a,0x85,0x85,0xc0,0xcf,0x9d,0x31,0x9d,
1563
+  0x22,0xbc,0xee,0x3c,0x2f,0xa1,0x74,0x6a,0x0,0x63,0xc,0x26,0x8a,0x70,0xce,0x22,
1564
+  0x2,0x62,0xc8,0x10,0xe,0xa8,0xf0,0x46,0x32,0xc1,0x79,0x9b,0x41,0xdb,0xe2,0xd9,
1565
+  0x1c,0x99,0x2f,0xc1,0xb3,0xa7,0xa2,0x6d,0x28,0xfb,0x35,0xb0,0xa4,0xbb,0xab,0x7,
1566
+  0x23,0x11,0x1a,0x14,0x14,0x90,0x7c,0x89,0x11,0xc4,0x28,0x63,0xe3,0xa3,0x20,0x9a,
1567
+  0xa1,0xec,0xe,0x9e,0xf,0x8a,0x1d,0xf0,0xf1,0x4a,0xbf,0x70,0x82,0xa7,0x4e,0x46,
1568
+  0x2f,0x5b,0xcb,0xfb,0x6d,0xc5,0x8a,0x69,0xef,0xe8,0xc0,0x65,0xa0,0x41,0x51,0x9d,
1569
+  0xe1,0x4a,0x0,0x51,0x4c,0x4,0x9d,0x1d,0xbd,0xb8,0x90,0x95,0x6a,0x13,0xb5,0x3d,
1570
+  0xc0,0xfd,0xae,0xc6,0xae,0x99,0xbc,0x59,0x2,0x4f,0x1e,0x8f,0x76,0xd8,0x8c,0x3d,
1571
+  0x8b,0x3a,0xba,0x28,0x46,0x25,0xb2,0x14,0xd0,0xdc,0xf9,0xc,0x3e,0x32,0xe3,0x87,
1572
+  0x44,0x82,0x89,0x4a,0x2c,0xee,0xba,0x85,0xd1,0xb1,0xcb,0xcf,0xa3,0xc,0x2,0x6f,
1573
+  0xcd,0x69,0xd1,0x8e,0xdf,0xa2,0xdb,0x9,0xfc,0x59,0x2e,0x57,0xab,0xd5,0x72,0x3b,
1574
+  0xea,0x73,0xe7,0x79,0xd6,0x5,0x6,0x25,0x34,0x67,0x21,0x48,0x4,0x5e,0x1d,0x57,
1575
+  0x6b,0xe3,0xa0,0x3c,0xf8,0xc5,0x46,0x7f,0x74,0x56,0x8b,0x1a,0x9,0x6f,0x13,0x51,
1576
+  0x5d,0xd4,0xd6,0x4e,0xe6,0xb8,0xd6,0xf3,0xeb,0x55,0x73,0x26,0xa2,0xa,0x2a,0x18,
1577
+  0x53,0x0,0x53,0x22,0x8d,0xb3,0xbd,0xc0,0xba,0x56,0x82,0x6d,0x27,0x8a,0x4b,0xdc,
1578
+  0x24,0x97,0x7a,0x7a,0x7a,0xb,0xa8,0xdc,0x1c,0xbc,0x59,0x9f,0xae,0x1d,0x2,0x60,
1579
+  0xe7,0xc9,0xdb,0xc0,0x8,0x62,0x60,0x74,0x74,0x4,0x29,0xb1,0xe9,0xbb,0x8d,0xf6,
1580
+  0x57,0x3,0x90,0xd4,0x78,0x3c,0x73,0x14,0xac,0x17,0xac,0x57,0x6c,0xe0,0xa6,0xd6,
1581
+  0x34,0x1c,0xe0,0x93,0x35,0x43,0xb8,0xa0,0x64,0xe,0xac,0x13,0x92,0x71,0x76,0x42,
1582
+  0x73,0xc8,0x49,0xcc,0x96,0x62,0x39,0x22,0xf3,0x4d,0xe7,0x37,0xe1,0xfe,0xcb,0xf5,
1583
+  0x43,0x73,0xf6,0x42,0xd5,0x60,0x27,0x2,0x51,0xa9,0x42,0x1a,0xc7,0xfd,0x2d,0x1,
1584
+  0xeb,0xa4,0xaf,0xa0,0x45,0xac,0x95,0xfc,0x88,0x34,0x5,0x8e,0x3c,0x70,0x11,0x80,
1585
+  0xed,0xc7,0xee,0x22,0xb,0x8d,0x16,0x68,0x7a,0x7f,0x66,0x3d,0x31,0xd4,0x87,0xb,
1586
+  0x92,0x33,0x28,0x91,0x85,0xe4,0xe,0x0,0x3,0xe0,0x85,0xb2,0xd,0x92,0x47,0xf7,
1587
+  0x79,0xfc,0x99,0x90,0xc3,0x1b,0x6,0x5a,0x6d,0x99,0xf,0xbe,0x7d,0xb8,0x8f,0x64,
1588
+  0x2a,0x50,0x1f,0xb,0xd8,0x0,0x99,0x3,0x6f,0x72,0xf3,0x79,0x2,0x65,0x42,0x33,
1589
+  0x4f,0x9b,0xcf,0x8f,0x5d,0xd4,0x3e,0xf7,0x6e,0xfa,0x7e,0xd3,0x5c,0x30,0xc0,0xd6,
1590
+  0xb,0x7d,0xb8,0xc9,0x40,0x36,0x16,0xf2,0xe0,0x1,0x1a,0x2e,0xe0,0x84,0xa9,0x56,
1591
+  0x82,0x46,0xcc,0xe9,0xc4,0x5b,0xac,0x87,0x2c,0x80,0x2f,0xa,0xf,0x9f,0xbb,0x73,
1592
+  0x5e,0xe0,0xcc,0xda,0xf2,0x4f,0x1f,0x71,0x2d,0x50,0x1f,0xc9,0x9d,0x5b,0x97,0xa7,
1593
+  0x9c,0x4a,0x1b,0x64,0x81,0x73,0x2d,0x81,0x78,0x90,0x1f,0x7d,0x87,0xc1,0x6,0xc1,
1594
+  0x3a,0xa1,0x3e,0xaa,0x34,0x1a,0xc2,0xe6,0x81,0xe5,0xb,0xc2,0x37,0xf,0x2e,0x27,
1595
+  0xa9,0x41,0x3c,0xa2,0xd8,0x20,0x64,0x5e,0xf2,0xff,0x7,0x21,0x29,0x5a,0xd2,0x11,
1596
+  0xf9,0xa5,0x25,0x70,0xe9,0x15,0xfb,0x43,0xe6,0xf9,0xfb,0x6a,0x56,0x6f,0x39,0xa9,
1597
+  0xf,0x7b,0xd2,0x58,0xd9,0xf0,0xd7,0x5c,0x91,0xfe,0x81,0x55,0x24,0x35,0x25,0x1e,
1598
+  0xf1,0x79,0xcf,0xfd,0xb5,0xd9,0x25,0xde,0xe1,0xcb,0x92,0x5e,0x3d,0xec,0xf,0xb6,
1599
+  0x4,0x80,0x89,0xfa,0xcf,0x61,0x6f,0x5c,0x4e,0xf1,0x46,0x70,0x4d,0x91,0x78,0xc8,
1600
+  0xd3,0x88,0x95,0x75,0x83,0x2b,0x5a,0xf0,0xd,0x3,